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

refactor: Get rid of header_utils.ts #7

Merged
merged 1 commit into from
May 18, 2022
Merged

refactor: Get rid of header_utils.ts #7

merged 1 commit into from
May 18, 2022

Conversation

bgoscinski
Copy link
Contributor

I noticed that most of the functions in header_utils.ts were not used and that setting header can be simplified by coercing init.headers to Headers instance.

Feel free to close this if you don't like this refactor :)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jd1378
Copy link
Owner

jd1378 commented May 18, 2022

there's many ways to set headers other than the Headers instance, I wanted to support them all, that's why the file exists.

@jd1378
Copy link
Owner

jd1378 commented May 18, 2022

are you sure it handles them all correctly ?

@jd1378
Copy link
Owner

jd1378 commented May 18, 2022

yeah okay I guess this is fine as well, thanks for letting me know I could do this

@jd1378 jd1378 merged commit a1b40c1 into jd1378:main May 18, 2022
@bgoscinski
Copy link
Contributor Author

Yes, I think it handles all the ways because we delegate to Headers constructor that accepts optional HeadersInit. RequestInit's headers property is declared also as HeadersInit so it's all compatible as far as I can tell :)

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