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.
This commit is contained in:
cinap_lenrek 2015-02-23 07:27:19 +01:00
parent 60fd51b9b7
commit cc77058aea

View file

@ -820,6 +820,8 @@ main(int argc, char *argv[])
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);
}