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

Content-Type not passing the regular expression for JSON smart parse #176

Closed
osukaa opened this issue Apr 21, 2017 · 4 comments
Closed

Content-Type not passing the regular expression for JSON smart parse #176

osukaa opened this issue Apr 21, 2017 · 4 comments
Labels
feature New functionality or improvement

Comments

@osukaa
Copy link

osukaa commented Apr 21, 2017

Hi,

I have a problem where contentful is returning me a Content-Type: application/vnd.contentful.delivery.v1+json but the regex doesn't pass and wreck.read returns the buffer instead of parsing it. json: force does the trick, but I think the regex should be updated. :)

https://regex101.com/r/ZX6nwW/1

@AdriVanHoudt
Copy link
Contributor

Adding 0-9 should work ^application\/[a-z0-9.+-]*json$ but I do not know if it could break anything, on a hunch I would say it is fine

@arb
Copy link
Contributor

arb commented Apr 24, 2017

I think this is why force was added... to deal with atypical content-type headers.

@geek geek added the request label Apr 24, 2017
@geek
Copy link
Member

geek commented Apr 24, 2017

@AdriVanHoudt @osukaa json is json, feel free to PR the update

@geek geek closed this as completed in d373039 Apr 25, 2017
geek added a commit that referenced this issue Apr 25, 2017
fix(json): allow numbers in mime fixes #176
@Marsup Marsup added feature New functionality or improvement and removed request labels Sep 20, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

5 participants