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

Don't check the contents of responseType #14

Closed
ghost opened this issue Feb 24, 2017 · 8 comments
Closed

Don't check the contents of responseType #14

ghost opened this issue Feb 24, 2017 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 24, 2017

The generated code makes a comparison to see if xhr.responseType === 'json' but in my current Chrome, for example, this variable is always set to the empty string.

The generated code should only rely on the content-type header, and even in the absence of this header I would suggest trying to parse it as json anyway, or at least making it an option.

@ghost
Copy link
Author

ghost commented Feb 24, 2017

Oh, sorry, I just noticed #13 ...I suggest merging it ;)

@minad
Copy link
Contributor

minad commented Mar 1, 2017

@chris-kahn Thanks for confirming. Sorry for the issue - I hope this gets fixed soon.

@phadej
Copy link
Contributor

phadej commented Mar 1, 2017

Has @minad or @chris-kahn tested it in some application that the fix actually works?

I'll merge and release #13 now, but I'll insist on adding tests for the next changes.

@minad
Copy link
Contributor

minad commented Mar 1, 2017

@phadej I tested it, maybe @chris-kahn could recheck too? I agree that automatic testing would be nice. But how do you do automatic browser tests in servant right now?

@phadej phadej added the bug label Mar 1, 2017
@phadej
Copy link
Contributor

phadej commented Mar 1, 2017

To clarify: I don't need automatic tests, but something so I can run a command and get a page where I can check things work. See #15

For example servant-swagger-ui has https://github.com/phadej/servant-swagger-ui/blob/master/example/Main.hs

@minad
Copy link
Contributor

minad commented Mar 1, 2017

Ok, makes sense!

@phadej
Copy link
Contributor

phadej commented Mar 1, 2017

0.9.3 is on Hackage

@phadej phadej closed this as completed Mar 1, 2017
@ghost
Copy link
Author

ghost commented Mar 1, 2017

I did test that it works, yes. Thanks for fixing it quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants