Parse-SDK-JS icon indicating copy to clipboard operation
Parse-SDK-JS copied to clipboard

fix: Chrome console warning `Refused to get unsafe header "access-control-expose-headers"` when calling Cloud Function

Open mortenmo opened this issue 1 year ago • 3 comments

Pull Request

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.

mortenmo avatar Mar 17 '24 16:03 mortenmo

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.

codecov[bot] avatar Mar 17 '24 16:03 codecov[bot]

Looking forward to seeing this error fixed!

onpix avatar Apr 04 '24 12:04 onpix

bump

lortonx avatar Apr 04 '24 13:04 lortonx

@mortenmo any updates?

dplewis avatar Apr 11 '24 12:04 dplewis

Thanks for the reminder it fell off my mind. Should be updated with your suggestions.

mortenmo avatar Apr 13 '24 14:04 mortenmo

Really looking forward to this being merged

REPTILEHAUS avatar Apr 17 '24 20:04 REPTILEHAUS

I wrote some tests. One mimicking the Chrome issue causing the log error. It fails if you revert RESTController and succeeds in this branch.

mortenmo avatar Apr 18 '24 01:04 mortenmo

Could you just fix the lint errors?

mtrezza avatar Apr 18 '24 14:04 mtrezza

There are still 2 open conversations, could you please reply there to see whether they can be closed?

mtrezza avatar Apr 19 '24 19:04 mtrezza

There are still 2 open conversations, could you please reply there to see whether they can be closed?

Done

mortenmo avatar Apr 22 '24 19:04 mortenmo

Thanks for closing the conversations.

mtrezza avatar Apr 22 '24 20:04 mtrezza

🎉 This change has been released in version 5.1.0-alpha.5

parseplatformorg avatar Apr 22 '24 20:04 parseplatformorg