-
Notifications
You must be signed in to change notification settings - Fork 6
InvalidOperationException: Cannot override system-specified headers #1
Comments
I've managed to resolve this by overriding the HTTP client the SDK uses. From the first behavior the application uses, before any call is made to AWS, you can set the AWSConfigs property:
|
Where do I put this code? |
@daveProgramming I added this to the first behavior loaded by the game. The AWSConfigs contains static variables so once it's set it should be re-used by all other instances of the SDK. |
Seems to work for me. Thanks! |
I had that problem too, thanks! |
I added
And it seems to work. At least in 2018.1.3 editor. |
Hey all, This worked great for me in Windows! However this seems to crash webgl. Anyone have alternatives to this for WebGL or know if its impossible? |
I'm using the Cognito service. This works for me as well. Thank you sooooo much! |
This also works for me in Mac and I am using the GameLift service. |
It works after adding Legogo's code in start function. thnx a lot. |
The line of code speficied doesn't seem to work in the latest version, could be that, at least with the assets in the Chess game example, AWSConfigs does not contain HttpClient |
With aws-sdk-unity_3.3.802.0 and Unity 2019.4.18f1 it seems that the solution with HttpClient is not working. Does anyone have an idea how to fix this? |
The code can't execute on Unity 2017.2.0f3
This issue is related to this issue:
aws/aws-sdk-net#643
The error message is as the following:
InvalidOperationException: Cannot override system-specified headers
UnityEngine.Networking.UnityWebRequest.SetRequestHeader (System.String name, System.String value) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/modules/UnityWebRequest/WebRequestBindings.gen.cs:511)
UnityEngine.WWW..ctor (System.String url, System.Byte[] postData, System.Collections.Generic.Dictionary`2 headers) (at /Users/builduser/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:62)
Amazon.Runtime.Internal.UnityMainThreadDispatcher+d__7.MoveNext () (at E:/JenkinsWorkspaces/v3-stage-release/AWSDotNetPublic/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:135)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests() (at E:/JenkinsWorkspaces/v3-stage-release/AWSDotNetPublic/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:73)
Amazon.Runtime.Internal.UnityMainThreadDispatcher:Update() (at E:/JenkinsWorkspaces/v3-stage-release/AWSDotNetPublic/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:59)
The text was updated successfully, but these errors were encountered: