Parse-SDK-JS
Parse-SDK-JS copied to clipboard
fix: Chrome console warning `Refused to get unsafe header "access-control-expose-headers"` when calling Cloud Function
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
https://github.com/parse-community/Parse-SDK-JS/issues/2059
Closes: #2059
Approach
Based on https://trackjs.com/blog/refused-unsafe-header/
Chrome shows a console error when accessing a non-existant header. Checking if header is available before calling that method.
Thanks for opening this pull request!
I will reformat the title to use the proper commit message syntax.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
72bc9ac) to head (ac3e1dd). Report is 11 commits behind head on alpha.
Additional details and impacted files
@@ Coverage Diff @@
## alpha #2095 +/- ##
===========================================
+ Coverage 99.98% 100.00% +0.01%
===========================================
Files 61 64 +3
Lines 6185 6198 +13
Branches 1499 1503 +4
===========================================
+ Hits 6184 6198 +14
+ Misses 1 0 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Looking forward to seeing this error fixed!
bump
@mortenmo any updates?
Thanks for the reminder it fell off my mind. Should be updated with your suggestions.
Really looking forward to this being merged
I wrote some tests. One mimicking the Chrome issue causing the log error. It fails if you revert RESTController and succeeds in this branch.
Could you just fix the lint errors?
There are still 2 open conversations, could you please reply there to see whether they can be closed?
There are still 2 open conversations, could you please reply there to see whether they can be closed?
Done
Thanks for closing the conversations.
🎉 This change has been released in version 5.1.0-alpha.5