File tree Expand file tree Collapse file tree 3 files changed +78
-1
lines changed Expand file tree Collapse file tree 3 files changed +78
-1
lines changed Original file line number Diff line number Diff line change @@ -1591,7 +1591,8 @@ CURLcode Curl_follow(struct Curl_easy *data,
1591
1591
1592
1592
DEBUGASSERT (data -> state .uh );
1593
1593
uc = curl_url_set (data -> state .uh , CURLUPART_URL , newurl ,
1594
- (type == FOLLOW_FAKE ) ? CURLU_NON_SUPPORT_SCHEME : 0 );
1594
+ (type == FOLLOW_FAKE ) ? CURLU_NON_SUPPORT_SCHEME :
1595
+ ((type == FOLLOW_REDIR ) ? CURLU_URLENCODE : 0 ) );
1595
1596
if (uc ) {
1596
1597
if (type != FOLLOW_FAKE )
1597
1598
return Curl_uc_to_curlcode (uc );
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ test626 test627 test628 test629 test630 test631 test632 test633 test634 \
84
84
test635 test636 test637 test638 test639 test640 test641 test642 \
85
85
test643 test644 test645 test646 test647 test648 test649 test650 test651 \
86
86
test652 test653 test654 test655 test656 test658 test659 test660 test661 \
87
+ test662 \
87
88
\
88
89
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
89
90
test709 test710 test711 test712 test713 test714 test715 test716 test717 \
Original file line number Diff line number Diff line change
1
+ <testcase>
2
+ <info>
3
+ <keywords>
4
+ HTTP
5
+ HTTP GET
6
+ followlocation
7
+ </keywords>
8
+ </info>
9
+ #
10
+ # Server-side
11
+ <reply>
12
+ <data>
13
+ HTTP/1.1 302 OK
14
+ Location: http://example.net/tes t case=/6620002
15
+ Date: Thu, 09 Nov 2010 14:49:00 GMT
16
+ Content-Length: 0
17
+
18
+ </data>
19
+ <data2>
20
+ HTTP/1.1 200 OK
21
+ Location: this should be ignored
22
+ Date: Thu, 09 Nov 2010 14:49:00 GMT
23
+ Content-Length: 5
24
+
25
+ body
26
+ </data2>
27
+ <datacheck>
28
+ HTTP/1.1 302 OK
29
+ Location: http://example.net/tes t case=/6620002
30
+ Date: Thu, 09 Nov 2010 14:49:00 GMT
31
+ Content-Length: 0
32
+
33
+ HTTP/1.1 200 OK
34
+ Location: this should be ignored
35
+ Date: Thu, 09 Nov 2010 14:49:00 GMT
36
+ Content-Length: 5
37
+
38
+ body
39
+ </datacheck>
40
+ </reply>
41
+
42
+ #
43
+ # Client-side
44
+ <client>
45
+ <server>
46
+ http
47
+ </server>
48
+ <name>
49
+ HTTP redirect with whitespace in absolute Location: URL
50
+ </name>
51
+ <command>
52
+ http://example.com/please/gimme/662 -L -x http://%HOSTIP:%HTTPPORT
53
+ </command>
54
+ </client>
55
+
56
+ #
57
+ # Verify data after the test has been "shot"
58
+ <verify>
59
+ <strip>
60
+ ^User-Agent:.*
61
+ </strip>
62
+ <protocol>
63
+ GET http://example.com/please/gimme/662 HTTP/1.1
64
+ Host: example.com
65
+ Accept: */*
66
+ Proxy-Connection: Keep-Alive
67
+
68
+ GET http://example.net/tes%20t%20case=/6620002 HTTP/1.1
69
+ Host: example.net
70
+ Accept: */*
71
+ Proxy-Connection: Keep-Alive
72
+
73
+ </protocol>
74
+ </verify>
75
+ </testcase>
You can’t perform that action at this time.
0 commit comments