-
Notifications
You must be signed in to change notification settings - Fork 9
Update README with response file format examples #6
Conversation
@vokalinteractive/ios-developers I added some example HTTP responses to the VOKMockUrlProtocol. Anyone care to take a look? |
Ah, so it was three blank lines to get it to work 😛 |
It's definitely good to have the examples, but I'm a bit concerned about the multiple consecutive blank lines—are those actually what a proper spec-compliant server would return? If not (and having an extra blank line to indicate a lack of headers is the one in particular that worries me), then we should be changing the code to fix the issue, rather than constructing strange |
At a quick search, nodejs/node-v0.x-archive#1711 seems to be the clearest indication I could find that the "no headers" case should be a blank line in place of the headers (i.e., two blank lines after the status line), but that the third blank line before the EOF shouldn't be necessary. @chillpop Could you take a look at that link and see if you come to the same conclusion before I try to fix the parsing? |
@vokal-isaac I agree with your reading of that link. |
|
||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In vokal-isaac/VOKMockUrlProtocol@924cd90, I've adjusted the regex so that it fits with our current understanding of what's standard, which means that this should be one blank line:
HTTP/1.1 202 Accepted
Content-Type: text/plain; charset=UTF-8
Date: Fri, 17 Oct 2014 14:12:46 GMT
Server: Apache-Coyote/1.1
Content-Length: 0
Connection: keep-alive
<EOF>
updated to be correct with the HTTP spec
@vokal-isaac, updated to match your regex changes. |
Good to pull—though I'd suggest holding off a few minutes and merging at the same time as #7. |
Update README with response file format examples
No description provided.