question

sghamaty@ultrabit.com avatar image
sghamaty@ultrabit.com asked

WebGL error "refused to set unsafe header accept-encoding"

After upgrading to the latest Playfab SDK, there is a setting to allow for "CompressApiData". This causes a permissions issue on Chrome with a Unity WebGL deployment. I believe most browsers by default enable gzip compression. This redundancy might cause a security error in a browser that breaks the connection attempt with an Unknown Error from the playfab SDK.

We have a temporary fix by adding an exclusion inside PlayFabWWW.cs in the UnitySDK to exclude WebGL on CompressApiData:

+#if !UNITY_WSA && !UNITY_WP8 && !UNITY_WEBGL

This should fix the problem. Let me run a test and confirm.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

Thanks! If this does indeed fix the issue, could you please submit this as a pull request to the SDK in GitHub?

0 Likes 0 ·

1 Answer

·
sghamaty@ultrabit.com avatar image
sghamaty@ultrabit.com answered

That does appear to fix it. Ill submit a patch.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1807605288 avatar image 1807605288 ♦ commented ·

For reference:

https://github.com/PlayFab/UnitySDK/pull/171

Your fix is accepted and committed, thanks!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.