parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
323 stars 261 forks source link

Parse and Unity 2017.1 #268

Closed kris-lom closed 6 years ago

kris-lom commented 7 years ago

Upgraded our project from 5.6.1 to 2017.1 and now we are getting the following WWW error during Parse initialisation

InvalidOperationException: Header value contains invalid characters UnityEngine.Networking.UnityWebRequest.SetRequestHeader (System.String name, System.String value) (at C:/buildslave/unity/build/artifacts/generated/common/modules/UnityWebRequest/WebRequestBindings.gen.cs:479) UnityEngine.WWW..ctor (System.String url, System.Byte[] postData, System.Collections.Generic.Dictionary`2 headers) (at C:/buildslave/unity/build/Runtime/WebRequestWWW/UWRWWW.cs:62) Parse.Internal.HttpClient.GenerateWWWInstance (System.String uri, System.Byte[] bytes, System.Collections.Hashtable headerTable) Parse.Internal.HttpClient+<>c__DisplayClass0_3.b5 () Parse.PlatformHooks+d51.MoveNext () UnityEngine.Debug:LogException(Exception) Parse.d__51:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Kerryuuu commented 7 years ago

Currently facing the same issue, unfortunately.

montymxb commented 7 years ago

@kris-lom looks like whatever value is being supplied to the request header is not a value value. Assuming it's not sensitive, can you pull out the name/value in question that's causing this to throw? It's possible there's a special character that needs to be escaped or something else that's causing it to be considered invalid.

Just so you know in terms of upgrading we have observed issues regarding VS 2017 not supporting silverlight projects among other things. It may or may not be related to this specific issue, but it's something to keep in mind.

Kerryuuu commented 7 years ago

I used @stewartmiles pull request and it works well. https://github.com/stewartmiles/Parse-SDK-dotNET

taktran commented 7 years ago

I have the same issue, and it seems the Unity 2017.1.0 editor can't parse parentheses in headers

https://issuetracker.unity3d.com/issues/www-unitywebrequest-invalidoperationexception-when-user-agent-header-contains-parenthesis

montymxb commented 6 years ago

@Officialwolftech If stewartmiles PR worked we just merged that in. Can you verify against the latest master?

It looks like as @taktran mentioned in the post that this was patched in Unity 2017.1.1p3. It would seem then that the issue is beyond the scope of this sdk and currently patched. I'm closing this out as resolved, let us know if this persists or something similar is seen in later versions.