auth zone: default is https if no 'http://' given.

git-svn-id: file:///svn/unbound/trunk@4536 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2018-02-13 14:28:51 +00:00
parent a554c14f18
commit a901fc5fe7

View file

@ -5916,16 +5916,16 @@ parse_url(char* url, char** host, char** file, int* port, int* ssl)
/* parse http://www.example.com/file.htm
* or http://127.0.0.1 (index.html)
* or https://[::1@1234]/a/b/c/d */
*ssl = 0;
*port = AUTH_HTTP_PORT;
*ssl = 1;
*port = AUTH_HTTPS_PORT;
/* parse http:// or https:// */
if(strncmp(p, "http://", 7) == 0) {
p += 7;
*ssl = 0;
*port = AUTH_HTTP_PORT;
} else if(strncmp(p, "https://", 8) == 0) {
p += 8;
*ssl = 1;
*port = AUTH_HTTPS_PORT;
} else if(strstr(p, "://") && strchr(p, '/') > strstr(p, "://") &&
strchr(p, ':') >= strstr(p, "://")) {
char* uri = dup_prefix(p, (size_t)(strstr(p, "://")-p));