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

Add ability to guess raw language type using content-type headers #80

Conversation

rutvik-gs
Copy link
Contributor

@rutvik-gs rutvik-gs commented Apr 16, 2024

Adding support in curlConverter to guess raw dataMode language type using headers if available

@rutvik-gs rutvik-gs force-pushed the fix/apidevp-6221/add-support-to-guess-raw-language-type branch 3 times, most recently from 9d33003 to ba9ce4e Compare April 16, 2024 13:49
@rutvik-gs rutvik-gs closed this Apr 16, 2024
@rutvik-gs rutvik-gs force-pushed the fix/apidevp-6221/add-support-to-guess-raw-language-type branch from ba9ce4e to a73189e Compare April 16, 2024 14:09
@rutvik-gs rutvik-gs reopened this Apr 16, 2024
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);
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@VShingala VShingala left a 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.

@rutvik-gs rutvik-gs force-pushed the fix/apidevp-6221/add-support-to-guess-raw-language-type branch from 95a3ebd to 4e6199b Compare April 16, 2024 18:00
@rutvik-gs rutvik-gs force-pushed the fix/apidevp-6221/add-support-to-guess-raw-language-type branch from 4e6199b to a2eeeb4 Compare April 16, 2024 18:02
@rutvik-gs rutvik-gs changed the title [APIDEVP-6221] Add ability to guess raw language type Add ability to guess raw language type using content-type headers Apr 16, 2024
Copy link
Member

@VShingala VShingala left a 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.

@VShingala VShingala merged commit 5eba9d8 into postmanlabs:develop Apr 17, 2024
3 checks passed
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.

2 participants