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 error message for missing content-type header #2197
Conversation
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.
This looks good, and I think it's worth the few extra bytes to help people diagnose issues loading modules. I've added one suggestion
If you could add a test for this, that would also be great, too. However, I won't block approval on it. |
Co-authored-by: Joel Denning <joeldenning@gmail.com>
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.
Thanks! I'll plan on merging and publishing tomorrow.
Sorry about the slow response. If you don't mind waiting, I could take a crack at writing a test tomorrow. It looks like it should go in |
Yes. Additionally, you'll need to configure the server to omit the content-type header from its response - see Lines 12 to 19 in d37f7ca
|
7f0b579
to
5b674cf
Compare
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.
The tests look good to me. I'll plan on merging and publishing this in the next day or so.
Currently, if the
Content-Type
header is missing from the response, the error that appears in the console isTypeError: Cannot read property 'match' of null
. I'd like to preempt that error with a more helpful one, reusing the existing Error #4.