mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
When we append stuff to the URL, we must make sure the text is properly
URL encoded before. Test case 58 added to verify this.
This commit is contained in:
parent
34c4ba4321
commit
571ceeff90
@ -2657,6 +2657,11 @@ operate(struct Configurable *config, int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
filep = config->infile;
|
filep = config->infile;
|
||||||
|
|
||||||
|
/* URL encode the file name */
|
||||||
|
filep = curl_escape(filep, 0 /* use strlen */);
|
||||||
|
|
||||||
|
if(filep) {
|
||||||
|
|
||||||
urlbuffer=(char *)malloc(strlen(url) + strlen(filep) + 3);
|
urlbuffer=(char *)malloc(strlen(url) + strlen(filep) + 3);
|
||||||
if(!urlbuffer) {
|
if(!urlbuffer) {
|
||||||
helpf("out of memory\n");
|
helpf("out of memory\n");
|
||||||
@ -2669,8 +2674,12 @@ operate(struct Configurable *config, int argc, char *argv[])
|
|||||||
/* thers is no trailing slash on the URL */
|
/* thers is no trailing slash on the URL */
|
||||||
sprintf(urlbuffer, "%s/%s", url, filep);
|
sprintf(urlbuffer, "%s/%s", url, filep);
|
||||||
|
|
||||||
|
curl_free(filep);
|
||||||
|
|
||||||
|
free(url);
|
||||||
url = urlbuffer; /* use our new URL instead! */
|
url = urlbuffer; /* use our new URL instead! */
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*VMS??-- Reading binary from files can be a problem... */
|
/*VMS??-- Reading binary from files can be a problem... */
|
||||||
/*VMS?? Only FIXED, VAR etc WITHOUT implied CC will work */
|
/*VMS?? Only FIXED, VAR etc WITHOUT implied CC will work */
|
||||||
/*VMS?? Others need a \n appended to a line */
|
/*VMS?? Others need a \n appended to a line */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user