Fixed HTTP-client query-string handling bug. master
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 11 Nov 2019 01:57:09 +0000 (02:57 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 11 Nov 2019 01:57:09 +0000 (02:57 +0100)
common/http.c

index 3ac3b14..77799a3 100644 (file)
@@ -224,8 +224,8 @@ static void consreq(struct htconn *cn)
     }
     if(*(cn->url->query)) {
        addtobuf(cn->outbuf, '?');
-       for(p = cn->url->path; *p; p++) {
-           if(!(*p & 0x80) && (safechars[(int)*p] || (*p == '&')))
+       for(p = cn->url->query; *p; p++) {
+           if(!(*p & 0x80) && (safechars[(int)*p] || (*p == '&') || (*p == '=')))
                addtobuf(cn->outbuf, *p);
            else
                bprintf(cn->outbuf, "%%%02X", *p);