-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: return text when content type is text/csv #579
Conversation
src/gaxios.ts
Outdated
@@ -404,6 +404,7 @@ export class Gaxios { | |||
return data as {}; | |||
} else if ( | |||
contentType.includes('text/plain') || | |||
contentType.includes('text/csv') || |
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.
Now I'm just thinking if we should instead do contentType.startsWith('text/')
and consider all text content the same. @sofisl what do you think?
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.
I agree! Would you mind including a regex instead? and maybe a .match
? Thank you!
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.
Thank you! We'll merge it and release soon.
src/gaxios.ts
Outdated
@@ -404,6 +404,7 @@ export class Gaxios { | |||
return data as {}; | |||
} else if ( | |||
contentType.includes('text/plain') || | |||
contentType.includes('text/csv') || |
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.
I agree! Would you mind including a regex instead? and maybe a .match
? Thank you!
contentType.includes('text/plain') || | ||
contentType.includes('text/html') | ||
) { | ||
} else if (contentType.match(/^text\//)) { |
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.
not sure how specific the regular expression should be, hope this suits.
Any chance of pushing this through? |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #578 🦕