Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix 1.0 POST to be RFC compliant

All requests with an entity body must have Content-Length set or
Transfer-Encoding set. Failure to do should result in HTTP 400 Bad
Request or HTTP 411 Length Required.
  • Loading branch information...
commit d929cec7456f03af8271fc16b90cbed21079596b 1 parent e405487
@mcunha mcunha authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  tests/HttpMachine.Tests/TestRequest.cs
View
3  tests/HttpMachine.Tests/TestRequest.cs
@@ -325,7 +325,7 @@ class TestRequest
},
new TestRequest() {
Name = "1.0 post",
- Raw = Encoding.ASCII.GetBytes("POST /foo HTTP/1.0\r\nFoo: Bar\r\n\r\nhelloworldhello"),
+ Raw = Encoding.ASCII.GetBytes("POST /foo HTTP/1.0\r\nContent-Length: 15\r\nFoo: Bar\r\n\r\nhelloworldhello"),
Method = "POST",
RequestUri = "/foo",
RequestPath = "/foo",
@@ -334,6 +334,7 @@ class TestRequest
VersionMajor = 1,
VersionMinor = 0,
Headers = new Dictionary<string,string>(StringComparer.InvariantCultureIgnoreCase) {
+ { "Content-Length", "15" },
{ "Foo", "Bar" }
},
Body = Encoding.UTF8.GetBytes("helloworldhello"),
Please sign in to comment.
Something went wrong with that request. Please try again.