"Unable to include control characters in HTTP header" using Parse

I used the login manager to my game using Parse and everything worked well.

So I added an online leaderboard, but now Unity runs this method every time:

void UpdateOnlineScore(string id, int newScore)  
{
    var query = ParseObject.GetQuery("tableName").WhereEqualTo("userid", id);

    query.FirstAsync().ContinueWith(t => {

        if (t.IsFaulted)
        {
            Debug.LogWarning("ID not found");

            // user stats not found create from scratch 
        } 
        else 
        {
            Debug.Log("Record found");

            ParseObject obj = t.Result;
            int savedScore = (int) obj.Get<int>("score");

            // check record
        }
    });
}

      

it stops when query.FirstAsync().ContinueWith(...)

throwing this exception:

ArgumentException: Cannot include control characters in the HTTP header, either as key or value.
UnityEngine.WWW.CheckSecurityOnHeaders (System.String [] headers) (in C: /BuildAgent/work/d63dfc6385190b60/Runtime/Export/WWW.cs: 98) UnityEngine.WWW..ctor (System.String url, System.Byte [ ] postData, System.Collections.Generic.Dictionary`2 headers) (in C: /BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/Utils.cs: 88) Parse.PlatformHooks.GenerateWWWInstance (System.String uri, System.Byte [ ] bytes, System.Collections.Hashtable headerTable) Parse.PlatformHooks + <> c__DisplayClass30 + <> c__DisplayClass36.b__29 () Parse.PlatformHooks + d__3c.MoveNext () UnityEngine.Debug: LogException (Exception): ParseNext3

I have no idea what I am doing wrong.
The strange thing is that I only get this error when debugging on the Web Player platform.
It is not displayed in Windows Standalone.

Am I missing something?

I am using Unity 4.6.0f3.

+3


source to share





All Articles