Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Update README with response file format examples #6

Merged
merged 2 commits into from
Oct 29, 2014

Conversation

chillpop
Copy link
Contributor

No description provided.

@chillpop
Copy link
Contributor Author

@vokalinteractive/ios-developers I added some example HTTP responses to the VOKMockUrlProtocol. Anyone care to take a look?

@designatednerd
Copy link
Contributor

Ah, so it was three blank lines to get it to work 😛

@vokal-isaac
Copy link
Contributor

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 .http files to work around (my) bad code.

@vokal-isaac
Copy link
Contributor

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?

@chillpop
Copy link
Contributor Author

@vokal-isaac I agree with your reading of that link.



```
Copy link
Contributor

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
@chillpop
Copy link
Contributor Author

@vokal-isaac, updated to match your regex changes.

@vokal-isaac
Copy link
Contributor

Good to pull—though I'd suggest holding off a few minutes and merging at the same time as #7.

designatednerd added a commit that referenced this pull request Oct 29, 2014
Update README with response file format examples
@designatednerd designatednerd merged commit ec0e2ef into vokal:master Oct 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants