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

chore: improve getResponseData #715

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Jul 12, 2024

first #711 should be merged, than I want to see if there is some aspects regarding resilience.

Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Jul 14, 2024

@gr2m
@wolfy1339
Do we need to support browsers? In Nodejs we have MIMEType class, and we can use it as a reliable content type parser. But if we need browser support we could e.g. use fast-content-type-parser (made by me and used in fastify).

@Uzlopak Uzlopak marked this pull request as ready for review July 14, 2024 10:45
@wolfy1339
Copy link
Member

The whole Octokit ecosystem (apart from some exceptions) has browser support.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Jul 14, 2024

@wolfy1339

I introduced the package fast-content-type-parse. It is a package I wrote myself, as I mentioned before. It is imho more reliable than using regexes. We use it in fastify. Using safeParse to not throw errors if the content type is invalid. The chance is imho slim.

Also i think i made it more resilient, because it has no chance to throw anymore ;).

@wolfy1339 wolfy1339 merged commit 2ce61f9 into octokit:main Jul 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants