question

giorgiotino avatar image
giorgiotino asked

Why Accept-Encoding has been changed to (deprecated) X-Accept-Econding?

Good morning,

I have recently downloaded the latest version of the Unity SDK, v. UnitySDK-2.99.201119

Among some (for us) non relevand Experimentation addition, I have noticed that the HTTP request headers in PlayFabUnityHttp.cs and PlayFabWWW.cs have changed.

Specifically, Accept-Encoding is now X-Accept-Encoding.

I was curious to know why this change, as it seems that X- prefix has been deprecated long time ago, especially for something like Accept-Encoding which is far from being experimental:


"Non-standard header fields were conventionally marked by prefixing the field name with X- but this convention was deprecated in June 2012 because of the inconveniences it caused when non-standard fields became standard."

link here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers and https://www.iana.org/assignments/message-headers/message-headers.xml

Why was this change required? Is it safe for me to upgrade from my current version UnitySDK-2.94.200901 ?

Thanks in advance for your reply.

apisunity3dsdks
10 |1200

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

Rick Chen avatar image
Rick Chen answered

Accept-encoding in the Unity version 2020.1 is not recommended. Please refer to: https://docs.unity3d.com/2020.1/Documentation/ScriptReference/Networking.UnityWebRequest.SetRequestHeader.html

Without upgrade to UnitySDK-2.99.201119 and if you are using Unity version 2020.1 or later, you could get spammy log. Please refer to this thread: https://community.playfab.com/questions/43345/getting-the-header-accept-encoding-is-managed-auto.html

As a workaround, our Unity SDK will be setting X-Accept-Encoding header instead, because Unity started showing warnings when our SDK sets Accept-Encoding header.

If your Unity version is not 2020.1 or later, it is not necessary to upgrade to UnitySDK-2.99.201119.

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.

giorgiotino avatar image giorgiotino commented ·

Thanks for the reply, I'll stick to the current version for now then

0 Likes 0 ·
Jérémie Fouché avatar image
Jérémie Fouché answered

@Junjin Chen

"If your Unity version is not 2020.1 or later, it is not necessary to upgrade to UnitySDK-2.99.201119."

Thank you but how to proceed so ??

4 comments
10 |1200

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

giorgiotino avatar image giorgiotino commented ·

I actually upgraded to the latest, and I do have unity 2019.4.18f and 2020.1.16f and both work without problems - so if you have 2020 just get the latest for sure to avoid spammy logs. You can use the latest for 2019 too, it does not hurt even if it not required.

0 Likes 0 ·
Jérémie Fouché avatar image Jérémie Fouché giorgiotino commented ·

You talk about that : https://github.com/PlayFab/UnitySDK ? Why its so hide ?

3. Editor Extensions SDK Installation/Update

  1. Log in using the Editor Extensions panel === >>> Its that : PlayFabEditorPrefsSO ?

I must fill all the lines ? if not which ones are obligatory ?

"Dev Account Token" => I dont find that anywhere. Its "Publisher ID" ?

Thanks you

0 Likes 0 ·
giorgiotino avatar image giorgiotino Jérémie Fouché commented ·

I guess this is a different question, though.

In any case, I do not use the Editor Extensions, I just perform the manual installation. I manually update the settings in the PlayFabSharedSettings scriptable object. I have it under:

PlayFabSDK/Shared/Public/Resources/

You do need the Dev Account Token, which you can find here:

https://developer.playfab.com/title/properties/{your title Id}

0 Likes 0 ·
Show more comments

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.