git: 9front

Download patch

ref: 141661b80084af9c746813a9c46a87eded298abe
parent: 37135ad87a40296c151ffaa53d9d43dbc94b8624
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Feb 23 02:27:19 EST 2015

webfs: check $httpproxy and error when its bogus

the httpproxy environment variable needs to be a url as stated
in the manpage, so give an error when it isnt.

--- a/sys/src/cmd/webfs/fs.c
+++ b/sys/src/cmd/webfs/fs.c
@@ -820,6 +820,8 @@
 
 	if(s = getenv("httpproxy")){
 		proxy = saneurl(url(s, 0));
+		if(proxy == nil || strcmp(proxy->scheme, "http") && strcmp(proxy->scheme, "https"))
+			sysfatal("invalid httpproxy url: %s", s);
 		free(s);
 	}
 
--