diff --git a/lib/urlapi.c b/lib/urlapi.c index 103e0a6b57..24b8bc244a 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -1912,11 +1912,11 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, return cc2cu(result); p = curlx_dyn_ptr(&enc); while(*p) { - /* make sure percent encoded are lower case */ + /* make sure percent encoded are upper case */ if((*p == '%') && ISXDIGIT(p[1]) && ISXDIGIT(p[2]) && - (ISUPPER(p[1]) || ISUPPER(p[2]))) { - p[1] = Curl_raw_tolower(p[1]); - p[2] = Curl_raw_tolower(p[2]); + (ISLOWER(p[1]) || ISLOWER(p[2]))) { + p[1] = Curl_raw_toupper(p[1]); + p[2] = Curl_raw_toupper(p[2]); p += 3; } else diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 3f520af253..7216d0a7c9 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -214,6 +214,7 @@ test1596 test1597 test1598 test1599 test1600 test1601 test1602 test1603 \ test1604 test1605 test1606 test1607 test1608 test1609 test1610 test1611 \ test1612 test1613 test1614 test1615 test1616 test1617 test1618 test1619 \ test1620 test1621 test1622 test1623 test1624 test1625 test1626 test1627 \ +test1628 \ \ test1630 test1631 test1632 test1633 test1634 test1635 test1636 test1637 \ test1638 test1639 test1640 test1641 test1642 test1643 test1644 \ diff --git a/tests/data/test1221 b/tests/data/test1221 index 322a5f878f..5ff7add995 100644 --- a/tests/data/test1221 +++ b/tests/data/test1221 @@ -44,7 +44,7 @@ content to _?!#$'|%LT%GT # Verify data after the test has been "shot" -POST /%TESTNUMBER?my+name+is+moo%5b%5d%AMPyes=s+i+r%AMPv_alue=content+to+_%3f%21%23%24%27%7c%3c%3e%0a%AMPcontent+to+_%3f%21%23%24%27%7c%3c%3e%0a%AMP%3d%3d HTTP/1.1 +POST /%TESTNUMBER?my+name+is+moo%5B%5D%AMPyes=s+i+r%AMPv_alue=content+to+_%3F%21%23%24%27%7C%3C%3E%0A%AMPcontent+to+_%3F%21%23%24%27%7C%3C%3E%0A%AMP%3D%3D HTTP/1.1 Host: %HOSTIP:%HTTPPORT User-Agent: curl/%VERSION Accept: */* diff --git a/tests/data/test1628 b/tests/data/test1628 new file mode 100644 index 0000000000..d5cf836787 --- /dev/null +++ b/tests/data/test1628 @@ -0,0 +1,53 @@ + + + + +HTTP +HTTP PUT + + +# Server-side + + +HTTP/1.0 200 OK swsclose +Date: Tue, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +blablabla + + + + +# Client-side + + +proxy + + +http + + +HTTP PUT from file with weird letters over a HTTP proxy + + +-x http://%HOSTIP:%HTTPPORT http://ssss/ -T %LOGDIR/%TESTNUMBERte[]st.txt + + +a few bytes + + + +# Verify data after the test has been "shot" + + +PUT http://ssss/%TESTNUMBERte%5B%5Dst.txt HTTP/1.1 +Host: ssss +User-Agent: curl/%VERSION +Accept: */* +Proxy-Connection: Keep-Alive +Content-Length: 12 + +a few bytes + + + diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 6d42b35694..6c3fff9bc9 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -1137,8 +1137,8 @@ static const struct setcase set_parts_list[] = { "https://host:1234/", 0, 0, CURLUE_OK, CURLUE_BAD_PORT_NUMBER}, {"https://host/", - "path=%4A%4B%4C,", - "https://host/%4a%4b%4c", + "path=%4A%4b%4C,", + "https://host/%4A%4B%4C", 0, 0, CURLUE_OK, CURLUE_OK}, {"https://host/mooo?q#f", "path=NULL,query=NULL,fragment=NULL,",