http_parser.rb 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/linux.yml +23 -0
- data/.github/workflows/windows.yml +23 -0
- data/.gitignore +5 -4
- data/.gitmodules +4 -4
- data/Gemfile +1 -1
- data/README.md +52 -47
- data/Rakefile +1 -0
- data/bench/standalone.rb +23 -0
- data/bench/thin.rb +1 -0
- data/ext/ruby_http_parser/extconf.rb +1 -1
- data/ext/ruby_http_parser/org/ruby_http_parser/RubyHttpParser.java +139 -83
- data/ext/ruby_http_parser/ruby_http_parser.c +40 -41
- data/ext/ruby_http_parser/vendor/http-parser-java/AUTHORS +32 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/LICENSE-MIT +5 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/README.md +133 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/TODO +6 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.c +1202 -671
- data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.gyp +79 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.h +172 -51
- data/ext/ruby_http_parser/vendor/http-parser-java/src/Http-parser.java.iml +22 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/FieldData.java +41 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPMethod.java +8 -3
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPParserUrl.java +76 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/ParserSettings.java +35 -102
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/Util.java +6 -6
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPParser.java +775 -682
- data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/ParserSettings.java +8 -4
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Message.java +70 -20
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/ParseUrl.java +51 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Requests.java +1 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Responses.java +1 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Test.java +2 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestHeaderOverflowError.java +1 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestLoaderNG.java +6 -17
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestNoOverflowLongBody.java +1 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/UnitTest.java +1 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Upgrade.java +1 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Url.java +127 -0
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Util.java +80 -9
- data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/WrongContentLength.java +2 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/test.c +1637 -280
- data/ext/ruby_http_parser/vendor/http-parser-java/tests.dumped +230 -71
- data/ext/ruby_http_parser/vendor/http-parser/AUTHORS +68 -0
- data/ext/ruby_http_parser/vendor/http-parser/LICENSE-MIT +1 -1
- data/ext/ruby_http_parser/vendor/http-parser/README.md +113 -38
- data/ext/ruby_http_parser/vendor/http-parser/bench.c +128 -0
- data/ext/ruby_http_parser/vendor/http-parser/contrib/parsertrace.c +157 -0
- data/ext/ruby_http_parser/vendor/http-parser/contrib/url_parser.c +47 -0
- data/ext/ruby_http_parser/vendor/http-parser/http_parser.c +1576 -780
- data/ext/ruby_http_parser/vendor/http-parser/http_parser.gyp +111 -0
- data/ext/ruby_http_parser/vendor/http-parser/http_parser.h +308 -58
- data/ext/ruby_http_parser/vendor/http-parser/test.c +2964 -460
- data/http_parser.rb.gemspec +14 -7
- data/spec/parser_spec.rb +196 -102
- data/spec/support/requests.json +236 -24
- data/spec/support/responses.json +202 -36
- data/tasks/compile.rake +2 -2
- data/tasks/fixtures.rake +8 -2
- data/tasks/spec.rake +1 -1
- metadata +141 -134
- data/Gemfile.lock +0 -32
- data/ext/ruby_http_parser/vendor/http-parser-java/compile +0 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/test_permutations +0 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/test_unit +0 -1
- data/ext/ruby_http_parser/vendor/http-parser-java/test_utf8 +0 -1
- data/ext/ruby_http_parser/vendor/http-parser/CONTRIBUTIONS +0 -4
data/spec/support/requests.json
CHANGED
@@ -18,7 +18,8 @@
|
|
18
18
|
"Host": "0.0.0.0=5000",
|
19
19
|
"Accept": "*/*"
|
20
20
|
},
|
21
|
-
"body": ""
|
21
|
+
"body": "",
|
22
|
+
"strict": true
|
22
23
|
},
|
23
24
|
{
|
24
25
|
"name": "firefox get",
|
@@ -44,7 +45,8 @@
|
|
44
45
|
"Keep-Alive": "300",
|
45
46
|
"Connection": "keep-alive"
|
46
47
|
},
|
47
|
-
"body": ""
|
48
|
+
"body": "",
|
49
|
+
"strict": true
|
48
50
|
},
|
49
51
|
{
|
50
52
|
"name": "dumbfuck",
|
@@ -63,7 +65,8 @@
|
|
63
65
|
"headers": {
|
64
66
|
"aaaaaaaaaaaaa": "++++++++++"
|
65
67
|
},
|
66
|
-
"body": ""
|
68
|
+
"body": "",
|
69
|
+
"strict": true
|
67
70
|
},
|
68
71
|
{
|
69
72
|
"name": "fragment in url",
|
@@ -79,7 +82,8 @@
|
|
79
82
|
"request_path": "/forums/1/topics/2375",
|
80
83
|
"request_url": "/forums/1/topics/2375?page=1#posts-17408",
|
81
84
|
"num_headers": 0,
|
82
|
-
"body": ""
|
85
|
+
"body": "",
|
86
|
+
"strict": true
|
83
87
|
},
|
84
88
|
{
|
85
89
|
"name": "get no headers no body",
|
@@ -95,7 +99,8 @@
|
|
95
99
|
"request_path": "/get_no_headers_no_body/world",
|
96
100
|
"request_url": "/get_no_headers_no_body/world",
|
97
101
|
"num_headers": 0,
|
98
|
-
"body": ""
|
102
|
+
"body": "",
|
103
|
+
"strict": true
|
99
104
|
},
|
100
105
|
{
|
101
106
|
"name": "get one header no body",
|
@@ -114,7 +119,8 @@
|
|
114
119
|
"headers": {
|
115
120
|
"Accept": "*/*"
|
116
121
|
},
|
117
|
-
"body": ""
|
122
|
+
"body": "",
|
123
|
+
"strict": true
|
118
124
|
},
|
119
125
|
{
|
120
126
|
"name": "get funky content length body hello",
|
@@ -133,7 +139,8 @@
|
|
133
139
|
"headers": {
|
134
140
|
"conTENT-Length": "5"
|
135
141
|
},
|
136
|
-
"body": "HELLO"
|
142
|
+
"body": "HELLO",
|
143
|
+
"strict": true
|
137
144
|
},
|
138
145
|
{
|
139
146
|
"name": "post identity body world",
|
@@ -154,7 +161,8 @@
|
|
154
161
|
"Transfer-Encoding": "identity",
|
155
162
|
"Content-Length": "5"
|
156
163
|
},
|
157
|
-
"body": "World"
|
164
|
+
"body": "World",
|
165
|
+
"strict": true
|
158
166
|
},
|
159
167
|
{
|
160
168
|
"name": "post - chunked body: all your base are belong to us",
|
@@ -173,7 +181,8 @@
|
|
173
181
|
"headers": {
|
174
182
|
"Transfer-Encoding": "chunked"
|
175
183
|
},
|
176
|
-
"body": "all your base are belong to us"
|
184
|
+
"body": "all your base are belong to us",
|
185
|
+
"strict": true
|
177
186
|
},
|
178
187
|
{
|
179
188
|
"name": "two chunks ; triple zero ending",
|
@@ -192,7 +201,8 @@
|
|
192
201
|
"headers": {
|
193
202
|
"Transfer-Encoding": "chunked"
|
194
203
|
},
|
195
|
-
"body": "hello world"
|
204
|
+
"body": "hello world",
|
205
|
+
"strict": true
|
196
206
|
},
|
197
207
|
{
|
198
208
|
"name": "chunked with trailing headers. blech.",
|
@@ -213,7 +223,8 @@
|
|
213
223
|
"Vary": "*",
|
214
224
|
"Content-Type": "text/plain"
|
215
225
|
},
|
216
|
-
"body": "hello world"
|
226
|
+
"body": "hello world",
|
227
|
+
"strict": true
|
217
228
|
},
|
218
229
|
{
|
219
230
|
"name": "with bullshit after the length",
|
@@ -232,7 +243,8 @@
|
|
232
243
|
"headers": {
|
233
244
|
"Transfer-Encoding": "chunked"
|
234
245
|
},
|
235
|
-
"body": "hello world"
|
246
|
+
"body": "hello world",
|
247
|
+
"strict": true
|
236
248
|
},
|
237
249
|
{
|
238
250
|
"name": "with quotes",
|
@@ -251,7 +263,8 @@
|
|
251
263
|
"headers": {
|
252
264
|
|
253
265
|
},
|
254
|
-
"body": ""
|
266
|
+
"body": "",
|
267
|
+
"strict": true
|
255
268
|
},
|
256
269
|
{
|
257
270
|
"name": "apachebench get",
|
@@ -272,7 +285,8 @@
|
|
272
285
|
"User-Agent": "ApacheBench/2.3",
|
273
286
|
"Accept": "*/*"
|
274
287
|
},
|
275
|
-
"body": ""
|
288
|
+
"body": "",
|
289
|
+
"strict": true
|
276
290
|
},
|
277
291
|
{
|
278
292
|
"name": "query url with question mark",
|
@@ -291,7 +305,8 @@
|
|
291
305
|
"headers": {
|
292
306
|
|
293
307
|
},
|
294
|
-
"body": ""
|
308
|
+
"body": "",
|
309
|
+
"strict": true
|
295
310
|
},
|
296
311
|
{
|
297
312
|
"name": "newline prefix get",
|
@@ -310,12 +325,13 @@
|
|
310
325
|
"headers": {
|
311
326
|
|
312
327
|
},
|
313
|
-
"body": ""
|
328
|
+
"body": "",
|
329
|
+
"strict": true
|
314
330
|
},
|
315
331
|
{
|
316
332
|
"name": "upgrade request",
|
317
333
|
"type": "HTTP_REQUEST",
|
318
|
-
"raw": "GET /demo HTTP/1.1\r\nHost: example.com\r\nConnection: Upgrade\r\nSec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\nSec-WebSocket-Protocol: sample\r\nUpgrade: WebSocket\r\nSec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\nOrigin: http://example.com\r\n\r\
|
334
|
+
"raw": "GET /demo HTTP/1.1\r\nHost: example.com\r\nConnection: Upgrade\r\nSec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\nSec-WebSocket-Protocol: sample\r\nUpgrade: WebSocket\r\nSec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\nOrigin: http://example.com\r\n\r\nHot diggity dogg",
|
319
335
|
"should_keep_alive": true,
|
320
336
|
"message_complete_on_eof": false,
|
321
337
|
"http_major": 1,
|
@@ -326,7 +342,7 @@
|
|
326
342
|
"request_path": "/demo",
|
327
343
|
"request_url": "/demo",
|
328
344
|
"num_headers": 7,
|
329
|
-
"upgrade":
|
345
|
+
"upgrade": "Hot diggity dogg",
|
330
346
|
"headers": {
|
331
347
|
"Host": "example.com",
|
332
348
|
"Connection": "Upgrade",
|
@@ -336,12 +352,13 @@
|
|
336
352
|
"Sec-WebSocket-Key1": "4 @1 46546xW%0l 1 5",
|
337
353
|
"Origin": "http://example.com"
|
338
354
|
},
|
339
|
-
"body": ""
|
355
|
+
"body": "",
|
356
|
+
"strict": true
|
340
357
|
},
|
341
358
|
{
|
342
359
|
"name": "connect request",
|
343
360
|
"type": "HTTP_REQUEST",
|
344
|
-
"raw": "CONNECT home0.netscape.com:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\
|
361
|
+
"raw": "CONNECT 0-home0.netscape.com:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\nsome data\r\nand yet even more data",
|
345
362
|
"should_keep_alive": false,
|
346
363
|
"message_complete_on_eof": false,
|
347
364
|
"http_major": 1,
|
@@ -350,14 +367,15 @@
|
|
350
367
|
"query_string": "",
|
351
368
|
"fragment": "",
|
352
369
|
"request_path": "",
|
353
|
-
"request_url": "home0.netscape.com:443",
|
370
|
+
"request_url": "0-home0.netscape.com:443",
|
354
371
|
"num_headers": 2,
|
355
|
-
"upgrade":
|
372
|
+
"upgrade": "some data\r\nand yet even more data",
|
356
373
|
"headers": {
|
357
374
|
"User-agent": "Mozilla/1.1N",
|
358
375
|
"Proxy-authorization": "basic aGVsbG86d29ybGQ="
|
359
376
|
},
|
360
|
-
"body": ""
|
377
|
+
"body": "",
|
378
|
+
"strict": true
|
361
379
|
},
|
362
380
|
{
|
363
381
|
"name": "report request",
|
@@ -376,7 +394,8 @@
|
|
376
394
|
"headers": {
|
377
395
|
|
378
396
|
},
|
379
|
-
"body": ""
|
397
|
+
"body": "",
|
398
|
+
"strict": true
|
380
399
|
},
|
381
400
|
{
|
382
401
|
"name": "request with no http version",
|
@@ -394,6 +413,199 @@
|
|
394
413
|
"num_headers": 0,
|
395
414
|
"headers": {
|
396
415
|
|
416
|
+
},
|
417
|
+
"body": "",
|
418
|
+
"strict": true
|
419
|
+
},
|
420
|
+
{
|
421
|
+
"name": "m-search request",
|
422
|
+
"type": "HTTP_REQUEST",
|
423
|
+
"raw": "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nMAN: \"ssdp:discover\"\r\nST: \"ssdp:all\"\r\n\r\n",
|
424
|
+
"should_keep_alive": true,
|
425
|
+
"message_complete_on_eof": false,
|
426
|
+
"http_major": 1,
|
427
|
+
"http_minor": 1,
|
428
|
+
"method": "M-SEARCH",
|
429
|
+
"query_string": "",
|
430
|
+
"fragment": "",
|
431
|
+
"request_path": "*",
|
432
|
+
"request_url": "*",
|
433
|
+
"num_headers": 3,
|
434
|
+
"headers": {
|
435
|
+
"HOST": "239.255.255.250:1900",
|
436
|
+
"MAN": "\"ssdp:discover\"",
|
437
|
+
"ST": "\"ssdp:all\""
|
438
|
+
},
|
439
|
+
"body": "",
|
440
|
+
"strict": true
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"name": "line folding in header value",
|
444
|
+
"type": "HTTP_REQUEST",
|
445
|
+
"raw": "GET / HTTP/1.1\r\nLine1: abc\r\n\tdef\r\n ghi\r\n\t\tjkl\r\n mno \r\n\t \tqrs\r\nLine2: \t line2\t\r\n\r\n",
|
446
|
+
"should_keep_alive": true,
|
447
|
+
"message_complete_on_eof": false,
|
448
|
+
"http_major": 1,
|
449
|
+
"http_minor": 1,
|
450
|
+
"method": "GET",
|
451
|
+
"query_string": "",
|
452
|
+
"fragment": "",
|
453
|
+
"request_path": "/",
|
454
|
+
"request_url": "/",
|
455
|
+
"num_headers": 2,
|
456
|
+
"headers": {
|
457
|
+
"Line1": "abc\tdef ghi\t\tjkl mno \t \tqrs",
|
458
|
+
"Line2": "line2\t"
|
459
|
+
},
|
460
|
+
"body": "",
|
461
|
+
"strict": true
|
462
|
+
},
|
463
|
+
{
|
464
|
+
"name": "host terminated by a query string",
|
465
|
+
"type": "HTTP_REQUEST",
|
466
|
+
"raw": "GET http://hypnotoad.org?hail=all HTTP/1.1\r\n\r\n",
|
467
|
+
"should_keep_alive": true,
|
468
|
+
"message_complete_on_eof": false,
|
469
|
+
"http_major": 1,
|
470
|
+
"http_minor": 1,
|
471
|
+
"method": "GET",
|
472
|
+
"query_string": "hail=all",
|
473
|
+
"fragment": "",
|
474
|
+
"request_path": "",
|
475
|
+
"request_url": "http://hypnotoad.org?hail=all",
|
476
|
+
"num_headers": 0,
|
477
|
+
"headers": {
|
478
|
+
|
479
|
+
},
|
480
|
+
"body": "",
|
481
|
+
"strict": true
|
482
|
+
},
|
483
|
+
{
|
484
|
+
"name": "host:port terminated by a query string",
|
485
|
+
"type": "HTTP_REQUEST",
|
486
|
+
"raw": "GET http://hypnotoad.org:1234?hail=all HTTP/1.1\r\n\r\n",
|
487
|
+
"should_keep_alive": true,
|
488
|
+
"message_complete_on_eof": false,
|
489
|
+
"http_major": 1,
|
490
|
+
"http_minor": 1,
|
491
|
+
"method": "GET",
|
492
|
+
"query_string": "hail=all",
|
493
|
+
"fragment": "",
|
494
|
+
"request_path": "",
|
495
|
+
"request_url": "http://hypnotoad.org:1234?hail=all",
|
496
|
+
"port": 1234,
|
497
|
+
"num_headers": 0,
|
498
|
+
"headers": {
|
499
|
+
|
500
|
+
},
|
501
|
+
"body": "",
|
502
|
+
"strict": true
|
503
|
+
},
|
504
|
+
{
|
505
|
+
"name": "host:port terminated by a space",
|
506
|
+
"type": "HTTP_REQUEST",
|
507
|
+
"raw": "GET http://hypnotoad.org:1234 HTTP/1.1\r\n\r\n",
|
508
|
+
"should_keep_alive": true,
|
509
|
+
"message_complete_on_eof": false,
|
510
|
+
"http_major": 1,
|
511
|
+
"http_minor": 1,
|
512
|
+
"method": "GET",
|
513
|
+
"query_string": "",
|
514
|
+
"fragment": "",
|
515
|
+
"request_path": "",
|
516
|
+
"request_url": "http://hypnotoad.org:1234",
|
517
|
+
"port": 1234,
|
518
|
+
"num_headers": 0,
|
519
|
+
"headers": {
|
520
|
+
|
521
|
+
},
|
522
|
+
"body": "",
|
523
|
+
"strict": true
|
524
|
+
},
|
525
|
+
{
|
526
|
+
"name": "PATCH request",
|
527
|
+
"type": "HTTP_REQUEST",
|
528
|
+
"raw": "PATCH /file.txt HTTP/1.1\r\nHost: www.example.com\r\nContent-Type: application/example\r\nIf-Match: \"e0023aa4e\"\r\nContent-Length: 10\r\n\r\ncccccccccc",
|
529
|
+
"should_keep_alive": true,
|
530
|
+
"message_complete_on_eof": false,
|
531
|
+
"http_major": 1,
|
532
|
+
"http_minor": 1,
|
533
|
+
"method": "PATCH",
|
534
|
+
"query_string": "",
|
535
|
+
"fragment": "",
|
536
|
+
"request_path": "/file.txt",
|
537
|
+
"request_url": "/file.txt",
|
538
|
+
"num_headers": 4,
|
539
|
+
"headers": {
|
540
|
+
"Host": "www.example.com",
|
541
|
+
"Content-Type": "application/example",
|
542
|
+
"If-Match": "\"e0023aa4e\"",
|
543
|
+
"Content-Length": "10"
|
544
|
+
},
|
545
|
+
"body": "cccccccccc",
|
546
|
+
"strict": true
|
547
|
+
},
|
548
|
+
{
|
549
|
+
"name": "connect caps request",
|
550
|
+
"type": "HTTP_REQUEST",
|
551
|
+
"raw": "CONNECT HOME0.NETSCAPE.COM:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\n",
|
552
|
+
"should_keep_alive": false,
|
553
|
+
"message_complete_on_eof": false,
|
554
|
+
"http_major": 1,
|
555
|
+
"http_minor": 0,
|
556
|
+
"method": "CONNECT",
|
557
|
+
"query_string": "",
|
558
|
+
"fragment": "",
|
559
|
+
"request_path": "",
|
560
|
+
"request_url": "HOME0.NETSCAPE.COM:443",
|
561
|
+
"num_headers": 2,
|
562
|
+
"upgrade": "",
|
563
|
+
"headers": {
|
564
|
+
"User-agent": "Mozilla/1.1N",
|
565
|
+
"Proxy-authorization": "basic aGVsbG86d29ybGQ="
|
566
|
+
},
|
567
|
+
"body": "",
|
568
|
+
"strict": true
|
569
|
+
},
|
570
|
+
{
|
571
|
+
"name": "utf-8 path request",
|
572
|
+
"type": "HTTP_REQUEST",
|
573
|
+
"strict": false,
|
574
|
+
"raw": "GET /δ¶/δt/pope?q=1#narf HTTP/1.1\r\nHost: github.com\r\n\r\n",
|
575
|
+
"should_keep_alive": true,
|
576
|
+
"message_complete_on_eof": false,
|
577
|
+
"http_major": 1,
|
578
|
+
"http_minor": 1,
|
579
|
+
"method": "GET",
|
580
|
+
"query_string": "q=1",
|
581
|
+
"fragment": "narf",
|
582
|
+
"request_path": "/δ¶/δt/pope",
|
583
|
+
"request_url": "/δ¶/δt/pope?q=1#narf",
|
584
|
+
"num_headers": 1,
|
585
|
+
"headers": {
|
586
|
+
"Host": "github.com"
|
587
|
+
},
|
588
|
+
"body": ""
|
589
|
+
},
|
590
|
+
{
|
591
|
+
"name": "hostname underscore",
|
592
|
+
"type": "HTTP_REQUEST",
|
593
|
+
"strict": false,
|
594
|
+
"raw": "CONNECT home_0.netscape.com:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\n",
|
595
|
+
"should_keep_alive": false,
|
596
|
+
"message_complete_on_eof": false,
|
597
|
+
"http_major": 1,
|
598
|
+
"http_minor": 0,
|
599
|
+
"method": "CONNECT",
|
600
|
+
"query_string": "",
|
601
|
+
"fragment": "",
|
602
|
+
"request_path": "",
|
603
|
+
"request_url": "home_0.netscape.com:443",
|
604
|
+
"num_headers": 2,
|
605
|
+
"upgrade": "",
|
606
|
+
"headers": {
|
607
|
+
"User-agent": "Mozilla/1.1N",
|
608
|
+
"Proxy-authorization": "basic aGVsbG86d29ybGQ="
|
397
609
|
},
|
398
610
|
"body": ""
|
399
611
|
}
|
data/spec/support/responses.json
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
"http_major": 1,
|
9
9
|
"http_minor": 1,
|
10
10
|
"status_code": 301,
|
11
|
+
"status": "Moved Permanently",
|
11
12
|
"num_headers": 8,
|
12
13
|
"headers": {
|
13
14
|
"Location": "http://www.google.com/",
|
@@ -19,7 +20,8 @@
|
|
19
20
|
"Server": "gws",
|
20
21
|
"Content-Length": "219 "
|
21
22
|
},
|
22
|
-
"body": "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n"
|
23
|
+
"body": "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>301 Moved</TITLE></HEAD><BODY>\n<H1>301 Moved</H1>\nThe document has moved\n<A HREF=\"http://www.google.com/\">here</A>.\r\n</BODY></HTML>\r\n",
|
24
|
+
"strict": true
|
23
25
|
},
|
24
26
|
{
|
25
27
|
"name": "no content-length response",
|
@@ -30,6 +32,7 @@
|
|
30
32
|
"http_major": 1,
|
31
33
|
"http_minor": 1,
|
32
34
|
"status_code": 200,
|
35
|
+
"status": "OK",
|
33
36
|
"num_headers": 5,
|
34
37
|
"headers": {
|
35
38
|
"Date": "Tue, 04 Aug 2009 07:59:32 GMT",
|
@@ -38,38 +41,43 @@
|
|
38
41
|
"Content-Type": "text/xml; charset=utf-8",
|
39
42
|
"Connection": "close"
|
40
43
|
},
|
41
|
-
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <SOAP-ENV:Body>\n <SOAP-ENV:Fault>\n <faultcode>SOAP-ENV:Client</faultcode>\n <faultstring>Client Error</faultstring>\n </SOAP-ENV:Fault>\n </SOAP-ENV:Body>\n</SOAP-ENV:Envelope>"
|
44
|
+
"body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <SOAP-ENV:Body>\n <SOAP-ENV:Fault>\n <faultcode>SOAP-ENV:Client</faultcode>\n <faultstring>Client Error</faultstring>\n </SOAP-ENV:Fault>\n </SOAP-ENV:Body>\n</SOAP-ENV:Envelope>",
|
45
|
+
"strict": true
|
42
46
|
},
|
43
47
|
{
|
44
48
|
"name": "404 no headers no body",
|
45
49
|
"type": "HTTP_RESPONSE",
|
46
50
|
"raw": "HTTP/1.1 404 Not Found\r\n\r\n",
|
47
|
-
"should_keep_alive":
|
48
|
-
"message_complete_on_eof":
|
51
|
+
"should_keep_alive": false,
|
52
|
+
"message_complete_on_eof": true,
|
49
53
|
"http_major": 1,
|
50
54
|
"http_minor": 1,
|
51
55
|
"status_code": 404,
|
56
|
+
"status": "Not Found",
|
52
57
|
"num_headers": 0,
|
53
58
|
"headers": {
|
54
59
|
|
55
60
|
},
|
56
61
|
"body_size": 0,
|
57
|
-
"body": ""
|
62
|
+
"body": "",
|
63
|
+
"strict": true
|
58
64
|
},
|
59
65
|
{
|
60
66
|
"name": "301 no response phrase",
|
61
67
|
"type": "HTTP_RESPONSE",
|
62
68
|
"raw": "HTTP/1.1 301\r\n\r\n",
|
63
|
-
"should_keep_alive":
|
64
|
-
"message_complete_on_eof":
|
69
|
+
"should_keep_alive": false,
|
70
|
+
"message_complete_on_eof": true,
|
65
71
|
"http_major": 1,
|
66
72
|
"http_minor": 1,
|
67
73
|
"status_code": 301,
|
74
|
+
"status": "",
|
68
75
|
"num_headers": 0,
|
69
76
|
"headers": {
|
70
77
|
|
71
78
|
},
|
72
|
-
"body": ""
|
79
|
+
"body": "",
|
80
|
+
"strict": true
|
73
81
|
},
|
74
82
|
{
|
75
83
|
"name": "200 trailing space on chunked body",
|
@@ -80,13 +88,15 @@
|
|
80
88
|
"http_major": 1,
|
81
89
|
"http_minor": 1,
|
82
90
|
"status_code": 200,
|
91
|
+
"status": "OK",
|
83
92
|
"num_headers": 2,
|
84
93
|
"headers": {
|
85
94
|
"Content-Type": "text/plain",
|
86
95
|
"Transfer-Encoding": "chunked"
|
87
96
|
},
|
88
97
|
"body_size": 65,
|
89
|
-
"body": "This is the data in the first chunk\r\nand this is the second one\r\n"
|
98
|
+
"body": "This is the data in the first chunk\r\nand this is the second one\r\n",
|
99
|
+
"strict": true
|
90
100
|
},
|
91
101
|
{
|
92
102
|
"name": "no carriage ret",
|
@@ -97,12 +107,14 @@
|
|
97
107
|
"http_major": 1,
|
98
108
|
"http_minor": 1,
|
99
109
|
"status_code": 200,
|
110
|
+
"status": "OK",
|
100
111
|
"num_headers": 2,
|
101
112
|
"headers": {
|
102
113
|
"Content-Type": "text/html; charset=utf-8",
|
103
114
|
"Connection": "close"
|
104
115
|
},
|
105
|
-
"body": "these headers are from http://news.ycombinator.com/"
|
116
|
+
"body": "these headers are from http://news.ycombinator.com/",
|
117
|
+
"strict": true
|
106
118
|
},
|
107
119
|
{
|
108
120
|
"name": "proxy connection",
|
@@ -113,6 +125,7 @@
|
|
113
125
|
"http_major": 1,
|
114
126
|
"http_minor": 1,
|
115
127
|
"status_code": 200,
|
128
|
+
"status": "OK",
|
116
129
|
"num_headers": 4,
|
117
130
|
"headers": {
|
118
131
|
"Content-Type": "text/html; charset=UTF-8",
|
@@ -120,7 +133,8 @@
|
|
120
133
|
"Proxy-Connection": "close",
|
121
134
|
"Date": "Thu, 31 Dec 2009 20:55:48 +0000"
|
122
135
|
},
|
123
|
-
"body": "hello world"
|
136
|
+
"body": "hello world",
|
137
|
+
"strict": true
|
124
138
|
},
|
125
139
|
{
|
126
140
|
"name": "underscore header key",
|
@@ -131,6 +145,7 @@
|
|
131
145
|
"http_major": 1,
|
132
146
|
"http_minor": 1,
|
133
147
|
"status_code": 200,
|
148
|
+
"status": "OK",
|
134
149
|
"num_headers": 4,
|
135
150
|
"headers": {
|
136
151
|
"Server": "DCLK-AdSvr",
|
@@ -138,7 +153,8 @@
|
|
138
153
|
"Content-Length": "0",
|
139
154
|
"DCLK_imp": "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o"
|
140
155
|
},
|
141
|
-
"body": ""
|
156
|
+
"body": "",
|
157
|
+
"strict": true
|
142
158
|
},
|
143
159
|
{
|
144
160
|
"name": "bonjourmadame.fr",
|
@@ -149,6 +165,7 @@
|
|
149
165
|
"http_major": 1,
|
150
166
|
"http_minor": 0,
|
151
167
|
"status_code": 301,
|
168
|
+
"status": "Moved Permanently",
|
152
169
|
"num_headers": 9,
|
153
170
|
"headers": {
|
154
171
|
"Date": "Thu, 03 Jun 2010 09:56:32 GMT",
|
@@ -161,28 +178,8 @@
|
|
161
178
|
"Content-Type": "text/html; charset=UTF-8",
|
162
179
|
"Connection": "keep-alive"
|
163
180
|
},
|
164
|
-
"body": ""
|
165
|
-
|
166
|
-
{
|
167
|
-
"name": "field space",
|
168
|
-
"type": "HTTP_RESPONSE",
|
169
|
-
"raw": "HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/6.0\r\nX-Powered-By: ASP.NET\r\nen-US Content-Type: text/xml\r\nContent-Type: text/xml\r\nContent-Length: 16\r\nDate: Fri, 23 Jul 2010 18:45:38 GMT\r\nConnection: keep-alive\r\n\r\n<xml>hello</xml>",
|
170
|
-
"should_keep_alive": true,
|
171
|
-
"message_complete_on_eof": false,
|
172
|
-
"http_major": 1,
|
173
|
-
"http_minor": 1,
|
174
|
-
"status_code": 200,
|
175
|
-
"num_headers": 7,
|
176
|
-
"headers": {
|
177
|
-
"Server": "Microsoft-IIS/6.0",
|
178
|
-
"X-Powered-By": "ASP.NET",
|
179
|
-
"en-US Content-Type": "text/xml",
|
180
|
-
"Content-Type": "text/xml",
|
181
|
-
"Content-Length": "16",
|
182
|
-
"Date": "Fri, 23 Jul 2010 18:45:38 GMT",
|
183
|
-
"Connection": "keep-alive"
|
184
|
-
},
|
185
|
-
"body": "<xml>hello</xml>"
|
181
|
+
"body": "",
|
182
|
+
"strict": true
|
186
183
|
},
|
187
184
|
{
|
188
185
|
"name": "field underscore",
|
@@ -193,6 +190,7 @@
|
|
193
190
|
"http_major": 1,
|
194
191
|
"http_minor": 1,
|
195
192
|
"status_code": 200,
|
193
|
+
"status": "OK",
|
196
194
|
"num_headers": 11,
|
197
195
|
"headers": {
|
198
196
|
"Date": "Tue, 28 Sep 2010 01:14:13 GMT",
|
@@ -207,7 +205,8 @@
|
|
207
205
|
"Content-Type": "text/html",
|
208
206
|
"Connection": "close"
|
209
207
|
},
|
210
|
-
"body": ""
|
208
|
+
"body": "",
|
209
|
+
"strict": true
|
211
210
|
},
|
212
211
|
{
|
213
212
|
"name": "non-ASCII in status line",
|
@@ -218,12 +217,179 @@
|
|
218
217
|
"http_major": 1,
|
219
218
|
"http_minor": 1,
|
220
219
|
"status_code": 500,
|
220
|
+
"status": "Oriëntatieprobleem",
|
221
221
|
"num_headers": 3,
|
222
222
|
"headers": {
|
223
223
|
"Date": "Fri, 5 Nov 2010 23:07:12 GMT+2",
|
224
224
|
"Content-Length": "0",
|
225
225
|
"Connection": "close"
|
226
226
|
},
|
227
|
-
"body": ""
|
227
|
+
"body": "",
|
228
|
+
"strict": true
|
229
|
+
},
|
230
|
+
{
|
231
|
+
"name": "http version 0.9",
|
232
|
+
"type": "HTTP_RESPONSE",
|
233
|
+
"raw": "HTTP/0.9 200 OK\r\n\r\n",
|
234
|
+
"should_keep_alive": false,
|
235
|
+
"message_complete_on_eof": true,
|
236
|
+
"http_major": 0,
|
237
|
+
"http_minor": 9,
|
238
|
+
"status_code": 200,
|
239
|
+
"status": "OK",
|
240
|
+
"num_headers": 0,
|
241
|
+
"headers": {
|
242
|
+
|
243
|
+
},
|
244
|
+
"body": "",
|
245
|
+
"strict": true
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"name": "neither content-length nor transfer-encoding response",
|
249
|
+
"type": "HTTP_RESPONSE",
|
250
|
+
"raw": "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nhello world",
|
251
|
+
"should_keep_alive": false,
|
252
|
+
"message_complete_on_eof": true,
|
253
|
+
"http_major": 1,
|
254
|
+
"http_minor": 1,
|
255
|
+
"status_code": 200,
|
256
|
+
"status": "OK",
|
257
|
+
"num_headers": 1,
|
258
|
+
"headers": {
|
259
|
+
"Content-Type": "text/plain"
|
260
|
+
},
|
261
|
+
"body": "hello world",
|
262
|
+
"strict": true
|
263
|
+
},
|
264
|
+
{
|
265
|
+
"name": "HTTP/1.0 with keep-alive and EOF-terminated 200 status",
|
266
|
+
"type": "HTTP_RESPONSE",
|
267
|
+
"raw": "HTTP/1.0 200 OK\r\nConnection: keep-alive\r\n\r\n",
|
268
|
+
"should_keep_alive": false,
|
269
|
+
"message_complete_on_eof": true,
|
270
|
+
"http_major": 1,
|
271
|
+
"http_minor": 0,
|
272
|
+
"status_code": 200,
|
273
|
+
"status": "OK",
|
274
|
+
"num_headers": 1,
|
275
|
+
"headers": {
|
276
|
+
"Connection": "keep-alive"
|
277
|
+
},
|
278
|
+
"body_size": 0,
|
279
|
+
"body": "",
|
280
|
+
"strict": true
|
281
|
+
},
|
282
|
+
{
|
283
|
+
"name": "HTTP/1.0 with keep-alive and a 204 status",
|
284
|
+
"type": "HTTP_RESPONSE",
|
285
|
+
"raw": "HTTP/1.0 204 No content\r\nConnection: keep-alive\r\n\r\n",
|
286
|
+
"should_keep_alive": true,
|
287
|
+
"message_complete_on_eof": false,
|
288
|
+
"http_major": 1,
|
289
|
+
"http_minor": 0,
|
290
|
+
"status_code": 204,
|
291
|
+
"status": "No content",
|
292
|
+
"num_headers": 1,
|
293
|
+
"headers": {
|
294
|
+
"Connection": "keep-alive"
|
295
|
+
},
|
296
|
+
"body_size": 0,
|
297
|
+
"body": "",
|
298
|
+
"strict": true
|
299
|
+
},
|
300
|
+
{
|
301
|
+
"name": "HTTP/1.1 with an EOF-terminated 200 status",
|
302
|
+
"type": "HTTP_RESPONSE",
|
303
|
+
"raw": "HTTP/1.1 200 OK\r\n\r\n",
|
304
|
+
"should_keep_alive": false,
|
305
|
+
"message_complete_on_eof": true,
|
306
|
+
"http_major": 1,
|
307
|
+
"http_minor": 1,
|
308
|
+
"status_code": 200,
|
309
|
+
"status": "OK",
|
310
|
+
"num_headers": 0,
|
311
|
+
"headers": {
|
312
|
+
|
313
|
+
},
|
314
|
+
"body_size": 0,
|
315
|
+
"body": "",
|
316
|
+
"strict": true
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"name": "HTTP/1.1 with a 204 status",
|
320
|
+
"type": "HTTP_RESPONSE",
|
321
|
+
"raw": "HTTP/1.1 204 No content\r\n\r\n",
|
322
|
+
"should_keep_alive": true,
|
323
|
+
"message_complete_on_eof": false,
|
324
|
+
"http_major": 1,
|
325
|
+
"http_minor": 1,
|
326
|
+
"status_code": 204,
|
327
|
+
"status": "No content",
|
328
|
+
"num_headers": 0,
|
329
|
+
"headers": {
|
330
|
+
|
331
|
+
},
|
332
|
+
"body_size": 0,
|
333
|
+
"body": "",
|
334
|
+
"strict": true
|
335
|
+
},
|
336
|
+
{
|
337
|
+
"name": "HTTP/1.1 with a 204 status and keep-alive disabled",
|
338
|
+
"type": "HTTP_RESPONSE",
|
339
|
+
"raw": "HTTP/1.1 204 No content\r\nConnection: close\r\n\r\n",
|
340
|
+
"should_keep_alive": false,
|
341
|
+
"message_complete_on_eof": false,
|
342
|
+
"http_major": 1,
|
343
|
+
"http_minor": 1,
|
344
|
+
"status_code": 204,
|
345
|
+
"status": "No content",
|
346
|
+
"num_headers": 1,
|
347
|
+
"headers": {
|
348
|
+
"Connection": "close"
|
349
|
+
},
|
350
|
+
"body_size": 0,
|
351
|
+
"body": "",
|
352
|
+
"strict": true
|
353
|
+
},
|
354
|
+
{
|
355
|
+
"name": "HTTP/1.1 with chunked endocing and a 200 response",
|
356
|
+
"type": "HTTP_RESPONSE",
|
357
|
+
"raw": "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n",
|
358
|
+
"should_keep_alive": true,
|
359
|
+
"message_complete_on_eof": false,
|
360
|
+
"http_major": 1,
|
361
|
+
"http_minor": 1,
|
362
|
+
"status_code": 200,
|
363
|
+
"status": "OK",
|
364
|
+
"num_headers": 1,
|
365
|
+
"headers": {
|
366
|
+
"Transfer-Encoding": "chunked"
|
367
|
+
},
|
368
|
+
"body_size": 0,
|
369
|
+
"body": "",
|
370
|
+
"strict": true
|
371
|
+
},
|
372
|
+
{
|
373
|
+
"name": "field space",
|
374
|
+
"type": "HTTP_RESPONSE",
|
375
|
+
"strict": false,
|
376
|
+
"raw": "HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/6.0\r\nX-Powered-By: ASP.NET\r\nen-US Content-Type: text/xml\r\nContent-Type: text/xml\r\nContent-Length: 16\r\nDate: Fri, 23 Jul 2010 18:45:38 GMT\r\nConnection: keep-alive\r\n\r\n<xml>hello</xml>",
|
377
|
+
"should_keep_alive": true,
|
378
|
+
"message_complete_on_eof": false,
|
379
|
+
"http_major": 1,
|
380
|
+
"http_minor": 1,
|
381
|
+
"status_code": 200,
|
382
|
+
"status": "OK",
|
383
|
+
"num_headers": 7,
|
384
|
+
"headers": {
|
385
|
+
"Server": "Microsoft-IIS/6.0",
|
386
|
+
"X-Powered-By": "ASP.NET",
|
387
|
+
"en-US Content-Type": "text/xml",
|
388
|
+
"Content-Type": "text/xml",
|
389
|
+
"Content-Length": "16",
|
390
|
+
"Date": "Fri, 23 Jul 2010 18:45:38 GMT",
|
391
|
+
"Connection": "keep-alive"
|
392
|
+
},
|
393
|
+
"body": "<xml>hello</xml>"
|
228
394
|
}
|
229
395
|
]
|