Closed Kiskae closed 2 weeks ago
@Kiskae Thanks for taking care of this. Never thought of the whitespaces 🤗
Personally, barely ever pass multiple content-types to Accept
Thank you for jumping on this so fast, @Kiskae! The changes look great. The only thing that's missing is an automated test for this.
Feel free to explore and add one, otherwise I will try to add it later next week. Thank you!
Added some tests. After looking at the RFC I realized that there are more complex accept headers that aren't being handled, but solving that probably involves adding dependencies. So I've just added some skipped tests as a reminder that they exist.
Also made it so the automated tests in src actually get executed :P
@Kiskae Thanks for taking care of this. Never thought of the whitespaces 🤗 Personally, barely ever pass multiple content-types to
Accept
Lets just say the reason I found this involves legacy applications and auto-generated openapi specs
This looks fantastic! Thank you for adding the tests, @Kiskae!
I've polished the things a bit, mostly around test names and changing the getAcceptedContentTypes
to accept just the Headers
instance (it never needed anything else from the request). Made it easier to test too.
This has been released in v0.3.1!
Make sure to always update to the latest version (npm i @mswjs/source@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
Fixes #61