Skip to content
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

Implement HasForeign instance #20

Merged
merged 3 commits into from
Nov 7, 2018

Conversation

afcady
Copy link

@afcady afcady commented Sep 17, 2018

This is three patches, to servant-foreign, servant-multipart, and servant-js.

https://github.com/haskell-servant/servant-multipart/compare/master...afcady:multipart-foreign?expand=1

https://github.com/haskell-servant/servant/compare/master...afcady:multipart-foreign?expand=1

https://github.com/haskell-servant/servant-js/compare/master...afcady:multipart-foreign?expand=1

The patch to servant-foreign adds a Boolean field to the Req type specifying whether the request body is JSON (as is currently assumed). The patch to servant-multipart implements a HasForeign instance that sets this field to False. The patch to servant-js changes the output of vanillaJS when the flag is false, so that JSON.stringify() does not get called on the body and the content-type is not set to JSON.

This address #5

@@ -40,7 +40,8 @@ library
text >=1.2 && <1.3,
transformers >=0.3 && <0.6,
wai >= 3.2 && <3.3,
wai-extra >=3.0 && <3.1
wai-extra >=3.0 && <3.1,
servant-foreign >= 0.11.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the dependencies sorted

@phadej phadej merged commit ec06d7a into haskell-servant:master Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants