-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocktail headers not parsed correctly? #170
Comments
Interesting. Maybe @JinlianWang, who is the one who implemented the Mocktail support in #108, has more information? But indeed I'd agree on fixing that and support both formats by checking the presence of a As for HTTPMessage that's the format generated by |
I might just be misunderstanding Mocktail. This https://github.com/kif-framework/AMYServer framework has th content type on line 4 then header key values on the following lines... |
Was not aware of the difference. I guess it is better to support both formats. |
Firstly, thanks so much for OHHTTPStubs.
I'm running into this error with loading stubs from Mocktail files:
Request failed: unacceptable content-type: content-type: application/json
From reading the code and this test project it looks like Line 4 of Mocktail files is always interpreted as the value of the
Content-Type
header.The documentation and reference implementation here https://github.com/puls/objc-mocktail/blob/master/Mocktail/Mocktail.m#L247 (which was transferred from the
square
github account topuls
) shows that Line 4 and every following line until a blank line are interpreted header keys and values.Fixing this might be considered an breaking change. But since the Mocktail format is far from standardized we could accept both formats by checking for a colon
:
on Line 4.PS: Is HTTPMessage similar to Mocktail? I tried to find some documentation of it on the web but kept coming up with Java and Ruby documention of classes with that name 😆.
The text was updated successfully, but these errors were encountered: