summaryrefslogtreecommitdiffstats
path: root/third_party/python/aiohttp/vendor/llhttp/test/request/uri.md
blob: 356863e6540927e852c2daa4264c91e90f87d315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
URI
===

## Quotes in URI

<!-- meta={"type": "request"} -->
```http
GET /with_"lovely"_quotes?foo=\"bar\" HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=33 span[url]="/with_"lovely"_quotes?foo=\"bar\""
off=38 url complete
off=43 len=3 span[version]="1.1"
off=46 version complete
off=50 headers complete method=1 v=1/1 flags=0 content_length=0
off=50 message complete
```

## Query URL with question mark

Some clients include `?` characters in query strings.

<!-- meta={"type": "request"} -->
```http
GET /test.cgi?foo=bar?baz HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=21 span[url]="/test.cgi?foo=bar?baz"
off=26 url complete
off=31 len=3 span[version]="1.1"
off=34 version complete
off=38 headers complete method=1 v=1/1 flags=0 content_length=0
off=38 message complete
```

## Host terminated by a query string

<!-- meta={"type": "request"} -->
```http
GET http://hypnotoad.org?hail=all HTTP/1.1\r\n


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=29 span[url]="http://hypnotoad.org?hail=all"
off=34 url complete
off=39 len=3 span[version]="1.1"
off=42 version complete
off=46 headers complete method=1 v=1/1 flags=0 content_length=0
off=46 message complete
```

## `host:port` terminated by a query string

<!-- meta={"type": "request"} -->
```http
GET http://hypnotoad.org:1234?hail=all HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=34 span[url]="http://hypnotoad.org:1234?hail=all"
off=39 url complete
off=44 len=3 span[version]="1.1"
off=47 version complete
off=51 headers complete method=1 v=1/1 flags=0 content_length=0
off=51 message complete
```

## Query URL with vertical bar character

It should be allowed to have vertical bar symbol in URI: `|`.

See: https://github.com/nodejs/node/issues/27584

<!-- meta={"type": "request"} -->
```http
GET /test.cgi?query=| HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=17 span[url]="/test.cgi?query=|"
off=22 url complete
off=27 len=3 span[version]="1.1"
off=30 version complete
off=34 headers complete method=1 v=1/1 flags=0 content_length=0
off=34 message complete
```

## `host:port` terminated by a space

<!-- meta={"type": "request"} -->
```http
GET http://hypnotoad.org:1234 HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=25 span[url]="http://hypnotoad.org:1234"
off=30 url complete
off=35 len=3 span[version]="1.1"
off=38 version complete
off=42 headers complete method=1 v=1/1 flags=0 content_length=0
off=42 message complete
```

## UTF-8 in URI path in loose mode

<!-- meta={"type": "request", "mode": "loose", "noScan": true} -->
```http
GET /δ¶/δt/космос/pope?q=1#narf HTTP/1.1
Host: github.com


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=36 span[url]="/δ¶/δt/космос/pope?q=1#narf"
off=41 url complete
off=46 len=3 span[version]="1.1"
off=49 version complete
off=51 len=4 span[header_field]="Host"
off=56 header_field complete
off=57 len=10 span[header_value]="github.com"
off=69 header_value complete
off=71 headers complete method=1 v=1/1 flags=0 content_length=0
off=71 message complete
```

## Disallow UTF-8 in URI path in strict mode

<!-- meta={"type": "request", "mode": "strict", "noScan": true} -->
```http
GET /δ¶/δt/pope?q=1#narf HTTP/1.1
Host: github.com


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=5 error code=7 reason="Invalid char in url path"
```

## Fragment in URI

<!-- meta={"type": "request"} -->
```http
GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=40 span[url]="/forums/1/topics/2375?page=1#posts-17408"
off=45 url complete
off=50 len=3 span[version]="1.1"
off=53 version complete
off=57 headers complete method=1 v=1/1 flags=0 content_length=0
off=57 message complete
```

## Underscore in hostname

<!-- meta={"type": "request"} -->
```http
CONNECT home_0.netscape.com:443 HTTP/1.0
User-agent: Mozilla/1.1N
Proxy-authorization: basic aGVsbG86d29ybGQ=


```

```log
off=0 message begin
off=0 len=7 span[method]="CONNECT"
off=7 method complete
off=8 len=23 span[url]="home_0.netscape.com:443"
off=32 url complete
off=37 len=3 span[version]="1.0"
off=40 version complete
off=42 len=10 span[header_field]="User-agent"
off=53 header_field complete
off=54 len=12 span[header_value]="Mozilla/1.1N"
off=68 header_value complete
off=68 len=19 span[header_field]="Proxy-authorization"
off=88 header_field complete
off=89 len=22 span[header_value]="basic aGVsbG86d29ybGQ="
off=113 header_value complete
off=115 headers complete method=5 v=1/0 flags=0 content_length=0
off=115 message complete
off=115 error code=22 reason="Pause on CONNECT/Upgrade"
```

## `host:port` and basic auth

<!-- meta={"type": "request"} -->
```http
GET http://a%12:b!&*$@hypnotoad.org:1234/toto HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=41 span[url]="http://a%12:b!&*$@hypnotoad.org:1234/toto"
off=46 url complete
off=51 len=3 span[version]="1.1"
off=54 version complete
off=58 headers complete method=1 v=1/1 flags=0 content_length=0
off=58 message complete
```

## Space in URI

<!-- meta={"type": "request", "noScan": true} -->
```http
GET /foo bar/ HTTP/1.1


```

```log
off=0 message begin
off=0 len=3 span[method]="GET"
off=3 method complete
off=4 len=4 span[url]="/foo"
off=9 url complete
off=9 error code=8 reason="Expected HTTP/"
```