[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 47/116: curl: pass through [] in URLs instead of ca
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 47/116: curl: pass through [] in URLs instead of calling globbing error |
Date: |
Tue, 05 Dec 2017 14:51:17 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 90abb74ff0e3134d8647722cee36b1815c14143d
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Nov 3 15:04:53 2017 +0200
curl: pass through [] in URLs instead of calling globbing error
Assisted-by: Per Lundberg
Fixes #2044
Closes #2046
Closes #2048
---
src/tool_urlglob.c | 8 +++++---
tests/data/Makefile.inc | 2 +-
tests/data/test1290 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index df85d7129..f78d058cd 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -367,9 +367,11 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
size_t sublen = 0;
while(*pattern && *pattern != '{') {
if(*pattern == '[') {
- /* Skip over potential IPv6 literals. */
- size_t skip;
- if(peek_ipv6(pattern, &skip)) {
+ /* skip over IPv6 literals and [] */
+ size_t skip = 0;
+ if(!peek_ipv6(pattern, &skip) && (pattern[1] == ']'))
+ skip = 2;
+ if(skip) {
memcpy(buf, pattern, skip);
buf += skip;
pattern += skip;
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index e3eb80e4d..35c41a5c1 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -137,7 +137,7 @@ test1252 test1253 test1254 test1255 test1256 test1257
test1258 test1259 \
test1260 test1261 test1262 \
\
test1280 test1281 test1282 test1283 test1284 test1285 test1286 test1287 \
-test1288 test1289 \
+test1288 test1289 test1290 \
test1298 test1299 \
test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \
test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \
diff --git a/tests/data/test1290 b/tests/data/test1290
new file mode 100644
index 000000000..e556303bf
--- /dev/null
+++ b/tests/data/test1290
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+globbing
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
+-foo-
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Verify URL globbing ignores []
+</name>
+<command>
+"http://%HOSTIP:%HTTPPORT/we/want/[]/page/1290"
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /we/want/[]/page/1290 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 56/116: Makefile.m32: allow to customize brotli libs, (continued)
- [GNUnet-SVN] [gnurl] 56/116: Makefile.m32: allow to customize brotli libs, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 64/116: imap: deal with commands case insensitively, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 34/116: select: update comments, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 31/116: cli tool: improve "; type=" handling in -F option arguments, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 53/116: HTTP: implement Brotli content encoding, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 36/116: runtests.pl: Fixed typo in message, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 37/116: mkhelp.pl: support reproducible build, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 55/116: travis: add a job with brotli enabled, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 63/116: connect: store IPv6 connection status after valid connection, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 32/116: timeval: use mach time on MacOS, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 47/116: curl: pass through [] in URLs instead of calling globbing error,
gnunet <=
- [GNUnet-SVN] [gnurl] 72/116: curl_share_setopt: va_end was not called if conncache errors, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 14/116: transfer: Fix chunked-encoding upload bug, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 49/116: RELEASE-NOTES: synced with ee8016b3d, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 48/116: curl: speed up handling of many URLs, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 43/116: tests: Fixed torture tests on tests 556 and 650, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 75/116: README.md: fixed layout, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 77/116: SMB: fix uninitialized local variable, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 27/116: RELEASE-NOTES: synced with f20cbac97, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 68/116: curl_share_setopt.3: document CURL_LOCK_DATA_CONNECT, gnunet, 2017/12/05
- [GNUnet-SVN] [gnurl] 52/116: HTTP: support multiple Content-Encodings, gnunet, 2017/12/05