midori_http_parser 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.gitmodules +6 -0
  4. data/.travis.yml +33 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE-MIT +20 -0
  7. data/README.md +90 -0
  8. data/Rakefile +6 -0
  9. data/bench/standalone.rb +23 -0
  10. data/bench/thin.rb +58 -0
  11. data/ext/ruby_http_parser/.gitignore +1 -0
  12. data/ext/ruby_http_parser/RubyHttpParserService.java +18 -0
  13. data/ext/ruby_http_parser/ext_help.h +18 -0
  14. data/ext/ruby_http_parser/extconf.rb +24 -0
  15. data/ext/ruby_http_parser/org/ruby_http_parser/RubyHttpParser.java +495 -0
  16. data/ext/ruby_http_parser/ruby_http_parser.c +516 -0
  17. data/ext/ruby_http_parser/vendor/.gitkeep +0 -0
  18. data/ext/ruby_http_parser/vendor/http-parser-java/AUTHORS +32 -0
  19. data/ext/ruby_http_parser/vendor/http-parser-java/LICENSE-MIT +48 -0
  20. data/ext/ruby_http_parser/vendor/http-parser-java/README.md +183 -0
  21. data/ext/ruby_http_parser/vendor/http-parser-java/TODO +28 -0
  22. data/ext/ruby_http_parser/vendor/http-parser-java/build.xml +74 -0
  23. data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.c +2175 -0
  24. data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.gyp +79 -0
  25. data/ext/ruby_http_parser/vendor/http-parser-java/http_parser.h +304 -0
  26. data/ext/ruby_http_parser/vendor/http-parser-java/src/Http-parser.java.iml +22 -0
  27. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/FieldData.java +41 -0
  28. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPCallback.java +8 -0
  29. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPDataCallback.java +34 -0
  30. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPErrorCallback.java +12 -0
  31. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPException.java +9 -0
  32. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPMethod.java +113 -0
  33. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPParser.java +36 -0
  34. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/HTTPParserUrl.java +76 -0
  35. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/ParserSettings.java +256 -0
  36. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/ParserType.java +13 -0
  37. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/Util.java +111 -0
  38. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPCallback.java +5 -0
  39. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPDataCallback.java +25 -0
  40. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPErrorCallback.java +7 -0
  41. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/HTTPParser.java +2171 -0
  42. data/ext/ruby_http_parser/vendor/http-parser-java/src/impl/http_parser/lolevel/ParserSettings.java +83 -0
  43. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Message.java +374 -0
  44. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/ParseUrl.java +51 -0
  45. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Requests.java +69 -0
  46. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Responses.java +52 -0
  47. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Test.java +16 -0
  48. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestHeaderOverflowError.java +48 -0
  49. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestLoaderNG.java +212 -0
  50. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/TestNoOverflowLongBody.java +62 -0
  51. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/UnitTest.java +117 -0
  52. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Upgrade.java +27 -0
  53. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Url.java +127 -0
  54. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/Util.java +236 -0
  55. data/ext/ruby_http_parser/vendor/http-parser-java/src/test/http_parser/lolevel/WrongContentLength.java +59 -0
  56. data/ext/ruby_http_parser/vendor/http-parser-java/test.c +3425 -0
  57. data/ext/ruby_http_parser/vendor/http-parser-java/tests.dumped +845 -0
  58. data/ext/ruby_http_parser/vendor/http-parser-java/tests.utf8 +17 -0
  59. data/ext/ruby_http_parser/vendor/http-parser-java/tools/byte_constants.rb +6 -0
  60. data/ext/ruby_http_parser/vendor/http-parser-java/tools/const_char.rb +13 -0
  61. data/ext/ruby_http_parser/vendor/http-parser-java/tools/lowcase.rb +15 -0
  62. data/ext/ruby_http_parser/vendor/http-parser-java/tools/parse_tests.rb +33 -0
  63. data/ext/ruby_http_parser/vendor/http-parser/AUTHORS +68 -0
  64. data/ext/ruby_http_parser/vendor/http-parser/LICENSE-MIT +23 -0
  65. data/ext/ruby_http_parser/vendor/http-parser/README.md +246 -0
  66. data/ext/ruby_http_parser/vendor/http-parser/bench.c +111 -0
  67. data/ext/ruby_http_parser/vendor/http-parser/contrib/parsertrace.c +160 -0
  68. data/ext/ruby_http_parser/vendor/http-parser/contrib/url_parser.c +47 -0
  69. data/ext/ruby_http_parser/vendor/http-parser/http_parser.c +2470 -0
  70. data/ext/ruby_http_parser/vendor/http-parser/http_parser.gyp +111 -0
  71. data/ext/ruby_http_parser/vendor/http-parser/http_parser.h +432 -0
  72. data/ext/ruby_http_parser/vendor/http-parser/test.c +4226 -0
  73. data/ext/ruby_http_parser/vendor/http-parser/test_fast +0 -0
  74. data/ext/ruby_http_parser/vendor/http-parser/test_g +0 -0
  75. data/lib/http/parser.rb +1 -0
  76. data/lib/http_parser.rb +21 -0
  77. data/midori_http_parser.gemspec +24 -0
  78. data/spec/parser_spec.rb +376 -0
  79. data/spec/spec_helper.rb +1 -0
  80. data/spec/support/requests.json +631 -0
  81. data/spec/support/responses.json +375 -0
  82. data/tasks/compile.rake +42 -0
  83. data/tasks/fixtures.rake +71 -0
  84. data/tasks/spec.rake +5 -0
  85. data/tasks/submodules.rake +7 -0
  86. metadata +206 -0
@@ -0,0 +1,845 @@
1
+ name :curl get
2
+ raw :"GET /test HTTP/1.1\r\nUser-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1\r\nHost: 0.0.0.0=5000\r\nAccept: */*\r\n\r\n"
3
+ type :HTTP_REQUEST
4
+ method: HTTP_GET
5
+ status_code :0
6
+ request_path:/test
7
+ request_url :/test
8
+ fragment :
9
+ query_string:
10
+ body :""
11
+ body_size :0
12
+ header_0 :{ "User-Agent": "curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1"}
13
+ header_1 :{ "Host": "0.0.0.0=5000"}
14
+ header_2 :{ "Accept": "*/*"}
15
+ should_keep_alive :1
16
+ http_major :1
17
+ http_minor :1
18
+
19
+ name :firefox get
20
+ raw :"GET /favicon.ico HTTP/1.1\r\nHost: 0.0.0.0=5000\r\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Encoding: gzip,deflate\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nKeep-Alive: 300\r\nConnection: keep-alive\r\n\r\n"
21
+ type :HTTP_REQUEST
22
+ method: HTTP_GET
23
+ status_code :0
24
+ request_path:/favicon.ico
25
+ request_url :/favicon.ico
26
+ fragment :
27
+ query_string:
28
+ body :""
29
+ body_size :0
30
+ header_0 :{ "Host": "0.0.0.0=5000"}
31
+ header_1 :{ "User-Agent": "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0"}
32
+ header_2 :{ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
33
+ header_3 :{ "Accept-Language": "en-us,en;q=0.5"}
34
+ header_4 :{ "Accept-Encoding": "gzip,deflate"}
35
+ header_5 :{ "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7"}
36
+ header_6 :{ "Keep-Alive": "300"}
37
+ header_7 :{ "Connection": "keep-alive"}
38
+ should_keep_alive :1
39
+ http_major :1
40
+ http_minor :1
41
+
42
+ name :dumbfuck
43
+ raw :"GET /dumbfuck HTTP/1.1\r\naaaaaaaaaaaaa:++++++++++\r\n\r\n"
44
+ type :HTTP_REQUEST
45
+ method: HTTP_GET
46
+ status_code :0
47
+ request_path:/dumbfuck
48
+ request_url :/dumbfuck
49
+ fragment :
50
+ query_string:
51
+ body :""
52
+ body_size :0
53
+ header_0 :{ "aaaaaaaaaaaaa": "++++++++++"}
54
+ should_keep_alive :1
55
+ http_major :1
56
+ http_minor :1
57
+
58
+ name :fragment in url
59
+ raw :"GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1\r\n\r\n"
60
+ type :HTTP_REQUEST
61
+ method: HTTP_GET
62
+ status_code :0
63
+ request_path:/forums/1/topics/2375
64
+ request_url :/forums/1/topics/2375?page=1#posts-17408
65
+ fragment :posts-17408
66
+ query_string:page=1
67
+ body :""
68
+ body_size :0
69
+ should_keep_alive :1
70
+ http_major :1
71
+ http_minor :1
72
+
73
+ name :get no headers no body
74
+ raw :"GET /get_no_headers_no_body/world HTTP/1.1\r\n\r\n"
75
+ type :HTTP_REQUEST
76
+ method: HTTP_GET
77
+ status_code :0
78
+ request_path:/get_no_headers_no_body/world
79
+ request_url :/get_no_headers_no_body/world
80
+ fragment :
81
+ query_string:
82
+ body :""
83
+ body_size :0
84
+ should_keep_alive :1
85
+ http_major :1
86
+ http_minor :1
87
+
88
+ name :get one header no body
89
+ raw :"GET /get_one_header_no_body HTTP/1.1\r\nAccept: */*\r\n\r\n"
90
+ type :HTTP_REQUEST
91
+ method: HTTP_GET
92
+ status_code :0
93
+ request_path:/get_one_header_no_body
94
+ request_url :/get_one_header_no_body
95
+ fragment :
96
+ query_string:
97
+ body :""
98
+ body_size :0
99
+ header_0 :{ "Accept": "*/*"}
100
+ should_keep_alive :1
101
+ http_major :1
102
+ http_minor :1
103
+
104
+ name :get funky content length body hello
105
+ raw :"GET /get_funky_content_length_body_hello HTTP/1.0\r\nconTENT-Length: 5\r\n\r\nHELLO"
106
+ type :HTTP_REQUEST
107
+ method: HTTP_GET
108
+ status_code :0
109
+ request_path:/get_funky_content_length_body_hello
110
+ request_url :/get_funky_content_length_body_hello
111
+ fragment :
112
+ query_string:
113
+ body :"HELLO"
114
+ body_size :0
115
+ header_0 :{ "conTENT-Length": "5"}
116
+ should_keep_alive :0
117
+ http_major :1
118
+ http_minor :0
119
+
120
+ name :post identity body world
121
+ raw :"POST /post_identity_body_world?q=search#hey HTTP/1.1\r\nAccept: */*\r\nTransfer-Encoding: identity\r\nContent-Length: 5\r\n\r\nWorld"
122
+ type :HTTP_REQUEST
123
+ method: HTTP_POST
124
+ status_code :0
125
+ request_path:/post_identity_body_world
126
+ request_url :/post_identity_body_world?q=search#hey
127
+ fragment :hey
128
+ query_string:q=search
129
+ body :"World"
130
+ body_size :0
131
+ header_0 :{ "Accept": "*/*"}
132
+ header_1 :{ "Transfer-Encoding": "identity"}
133
+ header_2 :{ "Content-Length": "5"}
134
+ should_keep_alive :1
135
+ http_major :1
136
+ http_minor :1
137
+
138
+ name :post - chunked body: all your base are belong to us
139
+ raw :"POST /post_chunked_all_your_base HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n1e\r\nall your base are belong to us\r\n0\r\n\r\n"
140
+ type :HTTP_REQUEST
141
+ method: HTTP_POST
142
+ status_code :0
143
+ request_path:/post_chunked_all_your_base
144
+ request_url :/post_chunked_all_your_base
145
+ fragment :
146
+ query_string:
147
+ body :"all your base are belong to us"
148
+ body_size :0
149
+ header_0 :{ "Transfer-Encoding": "chunked"}
150
+ should_keep_alive :1
151
+ http_major :1
152
+ http_minor :1
153
+
154
+ name :two chunks ; triple zero ending
155
+ raw :"POST /two_chunks_mult_zero_end HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n000\r\n\r\n"
156
+ type :HTTP_REQUEST
157
+ method: HTTP_POST
158
+ status_code :0
159
+ request_path:/two_chunks_mult_zero_end
160
+ request_url :/two_chunks_mult_zero_end
161
+ fragment :
162
+ query_string:
163
+ body :"hello world"
164
+ body_size :0
165
+ header_0 :{ "Transfer-Encoding": "chunked"}
166
+ should_keep_alive :1
167
+ http_major :1
168
+ http_minor :1
169
+
170
+ name :chunked with trailing headers. blech.
171
+ raw :"POST /chunked_w_trailing_headers HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nhello\r\n6\r\n world\r\n0\r\nVary: *\r\nContent-Type: text/plain\r\n\r\n"
172
+ type :HTTP_REQUEST
173
+ method: HTTP_POST
174
+ status_code :0
175
+ request_path:/chunked_w_trailing_headers
176
+ request_url :/chunked_w_trailing_headers
177
+ fragment :
178
+ query_string:
179
+ body :"hello world"
180
+ body_size :0
181
+ header_0 :{ "Transfer-Encoding": "chunked"}
182
+ header_1 :{ "Vary": "*"}
183
+ header_2 :{ "Content-Type": "text/plain"}
184
+ should_keep_alive :1
185
+ http_major :1
186
+ http_minor :1
187
+
188
+ name :with bullshit after the length
189
+ raw :"POST /chunked_w_bullshit_after_length HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n5; ihatew3;whatthefuck=aretheseparametersfor\r\nhello\r\n6; blahblah; blah\r\n world\r\n0\r\n\r\n"
190
+ type :HTTP_REQUEST
191
+ method: HTTP_POST
192
+ status_code :0
193
+ request_path:/chunked_w_bullshit_after_length
194
+ request_url :/chunked_w_bullshit_after_length
195
+ fragment :
196
+ query_string:
197
+ body :"hello world"
198
+ body_size :0
199
+ header_0 :{ "Transfer-Encoding": "chunked"}
200
+ should_keep_alive :1
201
+ http_major :1
202
+ http_minor :1
203
+
204
+ name :with quotes
205
+ raw :"GET /with_\"stupid\"_quotes?foo=\"bar\" HTTP/1.1\r\n\r\n"
206
+ type :HTTP_REQUEST
207
+ method: HTTP_GET
208
+ status_code :0
209
+ request_path:/with_"stupid"_quotes
210
+ request_url :/with_"stupid"_quotes?foo="bar"
211
+ fragment :
212
+ query_string:foo="bar"
213
+ body :""
214
+ body_size :0
215
+ should_keep_alive :1
216
+ http_major :1
217
+ http_minor :1
218
+
219
+ name :apachebench get
220
+ raw :"GET /test HTTP/1.0\r\nHost: 0.0.0.0:5000\r\nUser-Agent: ApacheBench/2.3\r\nAccept: */*\r\n\r\n"
221
+ type :HTTP_REQUEST
222
+ method: HTTP_GET
223
+ status_code :0
224
+ request_path:/test
225
+ request_url :/test
226
+ fragment :
227
+ query_string:
228
+ body :""
229
+ body_size :0
230
+ header_0 :{ "Host": "0.0.0.0:5000"}
231
+ header_1 :{ "User-Agent": "ApacheBench/2.3"}
232
+ header_2 :{ "Accept": "*/*"}
233
+ should_keep_alive :0
234
+ http_major :1
235
+ http_minor :0
236
+
237
+ name :query url with question mark
238
+ raw :"GET /test.cgi?foo=bar?baz HTTP/1.1\r\n\r\n"
239
+ type :HTTP_REQUEST
240
+ method: HTTP_GET
241
+ status_code :0
242
+ request_path:/test.cgi
243
+ request_url :/test.cgi?foo=bar?baz
244
+ fragment :
245
+ query_string:foo=bar?baz
246
+ body :""
247
+ body_size :0
248
+ should_keep_alive :1
249
+ http_major :1
250
+ http_minor :1
251
+
252
+ name :newline prefix get
253
+ raw :"\r\nGET /test HTTP/1.1\r\n\r\n"
254
+ type :HTTP_REQUEST
255
+ method: HTTP_GET
256
+ status_code :0
257
+ request_path:/test
258
+ request_url :/test
259
+ fragment :
260
+ query_string:
261
+ body :""
262
+ body_size :0
263
+ should_keep_alive :1
264
+ http_major :1
265
+ http_minor :1
266
+
267
+ name :upgrade request
268
+ 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"
269
+ type :HTTP_REQUEST
270
+ method: HTTP_GET
271
+ status_code :0
272
+ request_path:/demo
273
+ request_url :/demo
274
+ fragment :
275
+ query_string:
276
+ body :""
277
+ body_size :0
278
+ header_0 :{ "Host": "example.com"}
279
+ header_1 :{ "Connection": "Upgrade"}
280
+ header_2 :{ "Sec-WebSocket-Key2": "12998 5 Y3 1 .P00"}
281
+ header_3 :{ "Sec-WebSocket-Protocol": "sample"}
282
+ header_4 :{ "Upgrade": "WebSocket"}
283
+ header_5 :{ "Sec-WebSocket-Key1": "4 @1 46546xW%0l 1 5"}
284
+ header_6 :{ "Origin": "http://example.com"}
285
+ should_keep_alive :1
286
+ upgrade :"Hot diggity dogg"
287
+ http_major :1
288
+ http_minor :1
289
+
290
+ name :connect request
291
+ 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"
292
+ type :HTTP_REQUEST
293
+ method: HTTP_CONNECT
294
+ status_code :0
295
+ request_path:
296
+ request_url :0-home0.netscape.com:443
297
+ fragment :
298
+ query_string:
299
+ body :""
300
+ body_size :0
301
+ header_0 :{ "User-agent": "Mozilla/1.1N"}
302
+ header_1 :{ "Proxy-authorization": "basic aGVsbG86d29ybGQ="}
303
+ should_keep_alive :0
304
+ upgrade :"some data\r\nand yet even more data"
305
+ http_major :1
306
+ http_minor :0
307
+
308
+ name :report request
309
+ raw :"REPORT /test HTTP/1.1\r\n\r\n"
310
+ type :HTTP_REQUEST
311
+ method: HTTP_REPORT
312
+ status_code :0
313
+ request_path:/test
314
+ request_url :/test
315
+ fragment :
316
+ query_string:
317
+ body :""
318
+ body_size :0
319
+ should_keep_alive :1
320
+ http_major :1
321
+ http_minor :1
322
+
323
+ name :request with no http version
324
+ raw :"GET /\r\n\r\n"
325
+ type :HTTP_REQUEST
326
+ method: HTTP_GET
327
+ status_code :0
328
+ request_path:/
329
+ request_url :/
330
+ fragment :
331
+ query_string:
332
+ body :""
333
+ body_size :0
334
+ should_keep_alive :0
335
+ http_major :0
336
+ http_minor :9
337
+
338
+ name :m-search request
339
+ 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"
340
+ type :HTTP_REQUEST
341
+ method: HTTP_MSEARCH
342
+ status_code :0
343
+ request_path:*
344
+ request_url :*
345
+ fragment :
346
+ query_string:
347
+ body :""
348
+ body_size :0
349
+ header_0 :{ "HOST": "239.255.255.250:1900"}
350
+ header_1 :{ "MAN": ""ssdp:discover""}
351
+ header_2 :{ "ST": ""ssdp:all""}
352
+ should_keep_alive :1
353
+ http_major :1
354
+ http_minor :1
355
+
356
+ name :line folding in header value
357
+ raw :"GET / HTTP/1.1\r\nLine1: abc\r\n def\r\n ghi\r\n jkl\r\n mno \r\n qrs\r\nLine2: line2 \r\n\r\n"
358
+ type :HTTP_REQUEST
359
+ method: HTTP_GET
360
+ status_code :0
361
+ request_path:/
362
+ request_url :/
363
+ fragment :
364
+ query_string:
365
+ body :""
366
+ body_size :0
367
+ header_0 :{ "Line1": "abcdefghijklmno qrs"}
368
+ header_1 :{ "Line2": "line2 "}
369
+ should_keep_alive :1
370
+ http_major :1
371
+ http_minor :1
372
+
373
+ name :host terminated by a query string
374
+ raw :"GET http://hypnotoad.org?hail=all HTTP/1.1\r\n\r\n"
375
+ type :HTTP_REQUEST
376
+ method: HTTP_GET
377
+ status_code :0
378
+ request_path:
379
+ request_url :http://hypnotoad.org?hail=all
380
+ fragment :
381
+ query_string:hail=all
382
+ body :""
383
+ body_size :0
384
+ should_keep_alive :1
385
+ http_major :1
386
+ http_minor :1
387
+
388
+ name :host:port terminated by a query string
389
+ raw :"GET http://hypnotoad.org:1234?hail=all HTTP/1.1\r\n\r\n"
390
+ type :HTTP_REQUEST
391
+ method: HTTP_GET
392
+ status_code :0
393
+ request_path:
394
+ request_url :http://hypnotoad.org:1234?hail=all
395
+ fragment :
396
+ query_string:hail=all
397
+ body :""
398
+ body_size :0
399
+ should_keep_alive :1
400
+ http_major :1
401
+ http_minor :1
402
+
403
+ name :host:port terminated by a space
404
+ raw :"GET http://hypnotoad.org:1234 HTTP/1.1\r\n\r\n"
405
+ type :HTTP_REQUEST
406
+ method: HTTP_GET
407
+ status_code :0
408
+ request_path:
409
+ request_url :http://hypnotoad.org:1234
410
+ fragment :
411
+ query_string:
412
+ body :""
413
+ body_size :0
414
+ should_keep_alive :1
415
+ http_major :1
416
+ http_minor :1
417
+
418
+ name :PATCH request
419
+ 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"
420
+ type :HTTP_REQUEST
421
+ method: UNKNOWN
422
+ status_code :0
423
+ request_path:/file.txt
424
+ request_url :/file.txt
425
+ fragment :
426
+ query_string:
427
+ body :"cccccccccc"
428
+ body_size :0
429
+ header_0 :{ "Host": "www.example.com"}
430
+ header_1 :{ "Content-Type": "application/example"}
431
+ header_2 :{ "If-Match": ""e0023aa4e""}
432
+ header_3 :{ "Content-Length": "10"}
433
+ should_keep_alive :1
434
+ http_major :1
435
+ http_minor :1
436
+
437
+ name :connect caps request
438
+ raw :"CONNECT HOME0.NETSCAPE.COM:443 HTTP/1.0\r\nUser-agent: Mozilla/1.1N\r\nProxy-authorization: basic aGVsbG86d29ybGQ=\r\n\r\n"
439
+ type :HTTP_REQUEST
440
+ method: HTTP_CONNECT
441
+ status_code :0
442
+ request_path:
443
+ request_url :HOME0.NETSCAPE.COM:443
444
+ fragment :
445
+ query_string:
446
+ body :""
447
+ body_size :0
448
+ header_0 :{ "User-agent": "Mozilla/1.1N"}
449
+ header_1 :{ "Proxy-authorization": "basic aGVsbG86d29ybGQ="}
450
+ should_keep_alive :0
451
+ upgrade :""
452
+ http_major :1
453
+ http_minor :0
454
+
455
+ name :eat CRLF between requests, no "Connection: close" header
456
+ raw :"POST / HTTP/1.1\r\nHost: www.example.com\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 4\r\n\r\nq=42\r\n"
457
+ type :HTTP_REQUEST
458
+ method: HTTP_POST
459
+ status_code :0
460
+ request_path:/
461
+ request_url :/
462
+ fragment :
463
+ query_string:
464
+ body :"q=42"
465
+ body_size :0
466
+ header_0 :{ "Host": "www.example.com"}
467
+ header_1 :{ "Content-Type": "application/x-www-form-urlencoded"}
468
+ header_2 :{ "Content-Length": "4"}
469
+ should_keep_alive :1
470
+ http_major :1
471
+ http_minor :1
472
+
473
+ name :eat CRLF between requests even if "Connection: close" is set
474
+ raw :"POST / HTTP/1.1\r\nHost: www.example.com\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 4\r\nConnection: close\r\n\r\nq=42\r\n"
475
+ type :HTTP_REQUEST
476
+ method: HTTP_POST
477
+ status_code :0
478
+ request_path:/
479
+ request_url :/
480
+ fragment :
481
+ query_string:
482
+ body :"q=42"
483
+ body_size :0
484
+ header_0 :{ "Host": "www.example.com"}
485
+ header_1 :{ "Content-Type": "application/x-www-form-urlencoded"}
486
+ header_2 :{ "Content-Length": "4"}
487
+ header_3 :{ "Connection": "close"}
488
+ should_keep_alive :0
489
+ http_major :1
490
+ http_minor :1
491
+
492
+ name :PURGE request
493
+ raw :"PURGE /file.txt HTTP/1.1\r\nHost: www.example.com\r\n\r\n"
494
+ type :HTTP_REQUEST
495
+ method: UNKNOWN
496
+ status_code :0
497
+ request_path:/file.txt
498
+ request_url :/file.txt
499
+ fragment :
500
+ query_string:
501
+ body :""
502
+ body_size :0
503
+ header_0 :{ "Host": "www.example.com"}
504
+ should_keep_alive :1
505
+ http_major :1
506
+ http_minor :1
507
+
508
+ name :google 301
509
+ raw :"HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.google.com/\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Sun, 26 Apr 2009 11:11:49 GMT\r\nExpires: Tue, 26 May 2009 11:11:49 GMT\r\nX-$PrototypeBI-Version: 1.6.0.3\r\nCache-Control: public, max-age=2592000\r\nServer: gws\r\nContent-Length: 219 \r\n\r\n<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"
510
+ type :HTTP_RESPONSE
511
+ method: HTTP_DELETE
512
+ status_code :301
513
+ request_path:
514
+ request_url :
515
+ fragment :
516
+ query_string:
517
+ 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"
518
+ body_size :0
519
+ header_0 :{ "Location": "http://www.google.com/"}
520
+ header_1 :{ "Content-Type": "text/html; charset=UTF-8"}
521
+ header_2 :{ "Date": "Sun, 26 Apr 2009 11:11:49 GMT"}
522
+ header_3 :{ "Expires": "Tue, 26 May 2009 11:11:49 GMT"}
523
+ header_4 :{ "X-$PrototypeBI-Version": "1.6.0.3"}
524
+ header_5 :{ "Cache-Control": "public, max-age=2592000"}
525
+ header_6 :{ "Server": "gws"}
526
+ header_7 :{ "Content-Length": "219 "}
527
+ should_keep_alive :1
528
+ http_major :1
529
+ http_minor :1
530
+
531
+ name :no content-length response
532
+ raw :"HTTP/1.1 200 OK\r\nDate: Tue, 04 Aug 2009 07:59:32 GMT\r\nServer: Apache\r\nX-Powered-By: Servlet/2.5 JSP/2.1\r\nContent-Type: text/xml; charset=utf-8\r\nConnection: close\r\n\r\n<?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>"
533
+ type :HTTP_RESPONSE
534
+ method: HTTP_DELETE
535
+ status_code :200
536
+ request_path:
537
+ request_url :
538
+ fragment :
539
+ query_string:
540
+ 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>"
541
+ body_size :0
542
+ header_0 :{ "Date": "Tue, 04 Aug 2009 07:59:32 GMT"}
543
+ header_1 :{ "Server": "Apache"}
544
+ header_2 :{ "X-Powered-By": "Servlet/2.5 JSP/2.1"}
545
+ header_3 :{ "Content-Type": "text/xml; charset=utf-8"}
546
+ header_4 :{ "Connection": "close"}
547
+ should_keep_alive :0
548
+ http_major :1
549
+ http_minor :1
550
+
551
+ name :404 no headers no body
552
+ raw :"HTTP/1.1 404 Not Found\r\n\r\n"
553
+ type :HTTP_RESPONSE
554
+ method: HTTP_DELETE
555
+ status_code :404
556
+ request_path:
557
+ request_url :
558
+ fragment :
559
+ query_string:
560
+ body :""
561
+ body_size :0
562
+ should_keep_alive :0
563
+ http_major :1
564
+ http_minor :1
565
+
566
+ name :301 no response phrase
567
+ raw :"HTTP/1.1 301\r\n\r\n"
568
+ type :HTTP_RESPONSE
569
+ method: HTTP_DELETE
570
+ status_code :301
571
+ request_path:
572
+ request_url :
573
+ fragment :
574
+ query_string:
575
+ body :""
576
+ body_size :0
577
+ should_keep_alive :0
578
+ http_major :1
579
+ http_minor :1
580
+
581
+ name :200 trailing space on chunked body
582
+ raw :"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\n\r\n25 \r\nThis is the data in the first chunk\r\n\r\n1C\r\nand this is the second one\r\n\r\n0 \r\n\r\n"
583
+ type :HTTP_RESPONSE
584
+ method: HTTP_DELETE
585
+ status_code :200
586
+ request_path:
587
+ request_url :
588
+ fragment :
589
+ query_string:
590
+ body :"This is the data in the first chunk\r\nand this is the second one\r\n"
591
+ body_size :65
592
+ header_0 :{ "Content-Type": "text/plain"}
593
+ header_1 :{ "Transfer-Encoding": "chunked"}
594
+ should_keep_alive :1
595
+ http_major :1
596
+ http_minor :1
597
+
598
+ name :no carriage ret
599
+ raw :"HTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\nConnection: close\n\nthese headers are from http://news.ycombinator.com/"
600
+ type :HTTP_RESPONSE
601
+ method: HTTP_DELETE
602
+ status_code :200
603
+ request_path:
604
+ request_url :
605
+ fragment :
606
+ query_string:
607
+ body :"these headers are from http://news.ycombinator.com/"
608
+ body_size :0
609
+ header_0 :{ "Content-Type": "text/html; charset=utf-8"}
610
+ header_1 :{ "Connection": "close"}
611
+ should_keep_alive :0
612
+ http_major :1
613
+ http_minor :1
614
+
615
+ name :proxy connection
616
+ raw :"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 11\r\nProxy-Connection: close\r\nDate: Thu, 31 Dec 2009 20:55:48 +0000\r\n\r\nhello world"
617
+ type :HTTP_RESPONSE
618
+ method: HTTP_DELETE
619
+ status_code :200
620
+ request_path:
621
+ request_url :
622
+ fragment :
623
+ query_string:
624
+ body :"hello world"
625
+ body_size :0
626
+ header_0 :{ "Content-Type": "text/html; charset=UTF-8"}
627
+ header_1 :{ "Content-Length": "11"}
628
+ header_2 :{ "Proxy-Connection": "close"}
629
+ header_3 :{ "Date": "Thu, 31 Dec 2009 20:55:48 +0000"}
630
+ should_keep_alive :0
631
+ http_major :1
632
+ http_minor :1
633
+
634
+ name :underscore header key
635
+ raw :"HTTP/1.1 200 OK\r\nServer: DCLK-AdSvr\r\nContent-Type: text/xml\r\nContent-Length: 0\r\nDCLK_imp: v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o\r\n\r\n"
636
+ type :HTTP_RESPONSE
637
+ method: HTTP_DELETE
638
+ status_code :200
639
+ request_path:
640
+ request_url :
641
+ fragment :
642
+ query_string:
643
+ body :""
644
+ body_size :0
645
+ header_0 :{ "Server": "DCLK-AdSvr"}
646
+ header_1 :{ "Content-Type": "text/xml"}
647
+ header_2 :{ "Content-Length": "0"}
648
+ header_3 :{ "DCLK_imp": "v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o"}
649
+ should_keep_alive :1
650
+ http_major :1
651
+ http_minor :1
652
+
653
+ name :bonjourmadame.fr
654
+ raw :"HTTP/1.0 301 Moved Permanently\r\nDate: Thu, 03 Jun 2010 09:56:32 GMT\r\nServer: Apache/2.2.3 (Red Hat)\r\nCache-Control: public\r\nPragma: \r\nLocation: http://www.bonjourmadame.fr/\r\nVary: Accept-Encoding\r\nContent-Length: 0\r\nContent-Type: text/html; charset=UTF-8\r\nConnection: keep-alive\r\n\r\n"
655
+ type :HTTP_RESPONSE
656
+ method: HTTP_DELETE
657
+ status_code :301
658
+ request_path:
659
+ request_url :
660
+ fragment :
661
+ query_string:
662
+ body :""
663
+ body_size :0
664
+ header_0 :{ "Date": "Thu, 03 Jun 2010 09:56:32 GMT"}
665
+ header_1 :{ "Server": "Apache/2.2.3 (Red Hat)"}
666
+ header_2 :{ "Cache-Control": "public"}
667
+ header_3 :{ "Pragma": ""}
668
+ header_4 :{ "Location": "http://www.bonjourmadame.fr/"}
669
+ header_5 :{ "Vary": "Accept-Encoding"}
670
+ header_6 :{ "Content-Length": "0"}
671
+ header_7 :{ "Content-Type": "text/html; charset=UTF-8"}
672
+ header_8 :{ "Connection": "keep-alive"}
673
+ should_keep_alive :1
674
+ http_major :1
675
+ http_minor :0
676
+
677
+ name :field underscore
678
+ raw :"HTTP/1.1 200 OK\r\nDate: Tue, 28 Sep 2010 01:14:13 GMT\r\nServer: Apache\r\nCache-Control: no-cache, must-revalidate\r\nExpires: Mon, 26 Jul 1997 05:00:00 GMT\r\n.et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com\r\nVary: Accept-Encoding\r\n_eep-Alive: timeout=45\r\n_onnection: Keep-Alive\r\nTransfer-Encoding: chunked\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n0\r\n\r\n"
679
+ type :HTTP_RESPONSE
680
+ method: HTTP_DELETE
681
+ status_code :200
682
+ request_path:
683
+ request_url :
684
+ fragment :
685
+ query_string:
686
+ body :""
687
+ body_size :0
688
+ header_0 :{ "Date": "Tue, 28 Sep 2010 01:14:13 GMT"}
689
+ header_1 :{ "Server": "Apache"}
690
+ header_2 :{ "Cache-Control": "no-cache, must-revalidate"}
691
+ header_3 :{ "Expires": "Mon, 26 Jul 1997 05:00:00 GMT"}
692
+ header_4 :{ ".et-Cookie": "PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com"}
693
+ header_5 :{ "Vary": "Accept-Encoding"}
694
+ header_6 :{ "_eep-Alive": "timeout=45"}
695
+ header_7 :{ "_onnection": "Keep-Alive"}
696
+ header_8 :{ "Transfer-Encoding": "chunked"}
697
+ header_9 :{ "Content-Type": "text/html"}
698
+ header_10 :{ "Connection": "close"}
699
+ should_keep_alive :0
700
+ http_major :1
701
+ http_minor :1
702
+
703
+ name :non-ASCII in status line
704
+ raw :"HTTP/1.1 500 Oriëntatieprobleem\r\nDate: Fri, 5 Nov 2010 23:07:12 GMT+2\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
705
+ type :HTTP_RESPONSE
706
+ method: HTTP_DELETE
707
+ status_code :500
708
+ request_path:
709
+ request_url :
710
+ fragment :
711
+ query_string:
712
+ body :""
713
+ body_size :0
714
+ header_0 :{ "Date": "Fri, 5 Nov 2010 23:07:12 GMT+2"}
715
+ header_1 :{ "Content-Length": "0"}
716
+ header_2 :{ "Connection": "close"}
717
+ should_keep_alive :0
718
+ http_major :1
719
+ http_minor :1
720
+
721
+ name :http version 0.9
722
+ raw :"HTTP/0.9 200 OK\r\n\r\n"
723
+ type :HTTP_RESPONSE
724
+ method: HTTP_DELETE
725
+ status_code :200
726
+ request_path:
727
+ request_url :
728
+ fragment :
729
+ query_string:
730
+ body :""
731
+ body_size :0
732
+ should_keep_alive :0
733
+ http_major :0
734
+ http_minor :9
735
+
736
+ name :neither content-length nor transfer-encoding response
737
+ raw :"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nhello world"
738
+ type :HTTP_RESPONSE
739
+ method: HTTP_DELETE
740
+ status_code :200
741
+ request_path:
742
+ request_url :
743
+ fragment :
744
+ query_string:
745
+ body :"hello world"
746
+ body_size :0
747
+ header_0 :{ "Content-Type": "text/plain"}
748
+ should_keep_alive :0
749
+ http_major :1
750
+ http_minor :1
751
+
752
+ name :HTTP/1.0 with keep-alive and EOF-terminated 200 status
753
+ raw :"HTTP/1.0 200 OK\r\nConnection: keep-alive\r\n\r\n"
754
+ type :HTTP_RESPONSE
755
+ method: HTTP_DELETE
756
+ status_code :200
757
+ request_path:
758
+ request_url :
759
+ fragment :
760
+ query_string:
761
+ body :""
762
+ body_size :0
763
+ header_0 :{ "Connection": "keep-alive"}
764
+ should_keep_alive :0
765
+ http_major :1
766
+ http_minor :0
767
+
768
+ name :HTTP/1.0 with keep-alive and a 204 status
769
+ raw :"HTTP/1.0 204 No content\r\nConnection: keep-alive\r\n\r\n"
770
+ type :HTTP_RESPONSE
771
+ method: HTTP_DELETE
772
+ status_code :204
773
+ request_path:
774
+ request_url :
775
+ fragment :
776
+ query_string:
777
+ body :""
778
+ body_size :0
779
+ header_0 :{ "Connection": "keep-alive"}
780
+ should_keep_alive :1
781
+ http_major :1
782
+ http_minor :0
783
+
784
+ name :HTTP/1.1 with an EOF-terminated 200 status
785
+ raw :"HTTP/1.1 200 OK\r\n\r\n"
786
+ type :HTTP_RESPONSE
787
+ method: HTTP_DELETE
788
+ status_code :200
789
+ request_path:
790
+ request_url :
791
+ fragment :
792
+ query_string:
793
+ body :""
794
+ body_size :0
795
+ should_keep_alive :0
796
+ http_major :1
797
+ http_minor :1
798
+
799
+ name :HTTP/1.1 with a 204 status
800
+ raw :"HTTP/1.1 204 No content\r\n\r\n"
801
+ type :HTTP_RESPONSE
802
+ method: HTTP_DELETE
803
+ status_code :204
804
+ request_path:
805
+ request_url :
806
+ fragment :
807
+ query_string:
808
+ body :""
809
+ body_size :0
810
+ should_keep_alive :1
811
+ http_major :1
812
+ http_minor :1
813
+
814
+ name :HTTP/1.1 with a 204 status and keep-alive disabled
815
+ raw :"HTTP/1.1 204 No content\r\nConnection: close\r\n\r\n"
816
+ type :HTTP_RESPONSE
817
+ method: HTTP_DELETE
818
+ status_code :204
819
+ request_path:
820
+ request_url :
821
+ fragment :
822
+ query_string:
823
+ body :""
824
+ body_size :0
825
+ header_0 :{ "Connection": "close"}
826
+ should_keep_alive :0
827
+ http_major :1
828
+ http_minor :1
829
+
830
+ name :HTTP/1.1 with chunked endocing and a 200 response
831
+ raw :"HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\n"
832
+ type :HTTP_RESPONSE
833
+ method: HTTP_DELETE
834
+ status_code :200
835
+ request_path:
836
+ request_url :
837
+ fragment :
838
+ query_string:
839
+ body :""
840
+ body_size :0
841
+ header_0 :{ "Transfer-Encoding": "chunked"}
842
+ should_keep_alive :1
843
+ http_major :1
844
+ http_minor :1
845
+