mirror of
https://github.com/curl/curl.git
synced 2026-07-26 04:07:17 +03:00
url: fix CURLU and location following
Prior to this change if the user set a URL handle (CURLOPT_CURLU) it was incorrectly used for the location follow, resulting in infinite requests to the original location. Reported-by: sspiri@users.noreply.github.com Fixes https://github.com/curl/curl/issues/5709 Closes https://github.com/curl/curl/pull/5713
This commit is contained in:
parent
d8b8afe320
commit
a12a16151a
5 changed files with 133 additions and 4 deletions
|
|
@ -56,7 +56,7 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect \
|
|||
lib1534 lib1535 lib1536 lib1537 lib1538 lib1539 \
|
||||
lib1540 lib1541 \
|
||||
lib1550 lib1551 lib1552 lib1553 lib1554 lib1555 lib1556 lib1557 \
|
||||
lib1558 lib1559 lib1560 lib1564 lib1565 \
|
||||
lib1558 lib1559 lib1560 lib1564 lib1565 lib1567 \
|
||||
lib1591 lib1592 lib1593 lib1594 lib1596 \
|
||||
lib1900 lib1905 lib1906 lib1907 lib1908 lib1910 \
|
||||
lib2033 lib3010
|
||||
|
|
@ -604,6 +604,9 @@ lib1565_SOURCES = lib1565.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
|||
lib1565_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1565_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
lib1567_SOURCES = lib1567.c $(SUPPORTFILES)
|
||||
lib1567_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
lib1591_SOURCES = lib1591.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
|
||||
lib1591_LDADD = $(TESTUTIL_LIBS)
|
||||
lib1591_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1591
|
||||
|
|
|
|||
52
tests/libtest/lib1567.c
Normal file
52
tests/libtest/lib1567.c
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at https://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "test.h"
|
||||
|
||||
#include "memdebug.h"
|
||||
|
||||
#include <curl/multi.h>
|
||||
|
||||
int test(char *URL)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
global_init(CURL_GLOBAL_ALL);
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
CURLU *u = curl_url();
|
||||
if(u) {
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_url_set(u, CURLUPART_URL, URL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_CURLU, u);
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
fprintf(stderr, "****************************** Do it again\n");
|
||||
res = curl_easy_perform(curl);
|
||||
curl_url_cleanup(u);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
return (int)res;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue