FreeBSD Bugzilla – Attachment 232193 Details for
Bug 262283
encoding of + in libfetch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
git diff in /lib/libfetch against 14-CURRENT
libfetch.diff (text/plain), 1.24 KB, created by
Ronald Klop
on 2022-03-01 20:13:57 UTC
(
hide
)
Description:
git diff in /lib/libfetch against 14-CURRENT
Filename:
MIME Type:
Creator:
Ronald Klop
Created:
2022-03-01 20:13:57 UTC
Size:
1.24 KB
patch
obsolete
>diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c >index 82a3c5e451a..eed466018e3 100644 >--- a/lib/libfetch/fetch.c >+++ b/lib/libfetch/fetch.c >@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); > > #include <errno.h> > #include <ctype.h> >+#include <stdbool.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> >@@ -443,15 +444,25 @@ fetchParseURL(const char *URL) > if (strcmp(u->scheme, SCHEME_HTTP) == 0 || > strcmp(u->scheme, SCHEME_HTTPS) == 0) { > const char hexnums[] = "0123456789abcdef"; >+ bool in_query_string = false; > > /* percent-escape whitespace. */ >+ /* Some servers do not handle '+' properly. In the path it must be >+ * literal. In the query string it can be an encoded space. >+ * Percent-escape the '+' in the path to be unambiguous to the server. >+ * https://www.w3.org/Addressing/URL/4_URI_Recommentations.html >+ * https://forums.aws.amazon.com/thread.jspa?threadID=55746 >+ */ > if ((doc = malloc(strlen(p) * 3 + 1)) == NULL) { > fetch_syserr(); > goto ouch; > } > u->doc = doc; > while (*p != '\0') { >- if (!isspace((unsigned char)*p)) { >+ if (*p == '?') { >+ in_query_string = true; >+ } >+ if (!isspace((unsigned char)*p) && (in_query_string || *p != '+')) { > *doc++ = *p++; > } else { > *doc++ = '%';
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ronald-lists
:
maintainer-approval?
(
des
)
Actions:
View
|
Diff
Attachments on
bug 262283
: 232193