]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
auth zone: default is https if no 'http://' given.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 Feb 2018 14:28:51 +0000 (14:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 Feb 2018 14:28:51 +0000 (14:28 +0000)
git-svn-id: file:///svn/unbound/trunk@4536 be551aaa-1e26-0410-a405-d3ace91eadb9

services/authzone.c

index 5e26c3087c6077e8a866b1ee4ba0ddf599a65614..1da924d841eaef85cd0f6900c2239386711374b2 100644 (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));