-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add ability to guess raw language type using content-type headers #80
Add ability to guess raw language type using content-type headers #80
Conversation
9d33003
to
ba9ce4e
Compare
ba9ce4e
to
a73189e
Compare
src/lib.js
Outdated
request.body.options.raw = {}; | ||
request.body.options.raw.language = Object.keys(LANGUAGE_REGEX_MATCH) | ||
.find((key) => { | ||
return LANGUAGE_REGEX_MATCH[key].test(content_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap this around try catch? This is to make sure regex doesn't break entire import in case of bad input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I have made the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one comment, rest looks good.
95a3ebd
to
4e6199b
Compare
4e6199b
to
a2eeeb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good. I'll merge this and create a release.
Adding support in
curlConverter
to guess raw dataMode language type using headers if available