- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
Stranger-Games · Aug 24, 2016 at 02:23 PM ·
networkingheadersheader
Serious Bug UnityWebRequest.SetRequestHeader is not working in non development mode on Android
Hi,
I have an android app with the following
post.SetRequestHeader("Authorization", authorizationHeader);
Which works perfectly when I build with 'Development Build' option, but the header is not set when I run the same exact code on device with 'Development Build' off.
The following code also runs with development build option on, but doesn't work with the option off.
MethodInfo dynMethod = post.GetType().GetMethod("InternalSetRequestHeader", BindingFlags.NonPublic | BindingFlags.Instance);
dynMethod.Invoke(post, new object[] { "Authorization", authorizationHeader });
I am using Unity 5.4.0f3 Any help is greatly appreciated.
Edit:
The same problem happens with iOS build with 'development build' option off.
Comment
Best Answer
Answer by Stranger-Games · Aug 26, 2016 at 07:58 AM
It seems to be a mistake from the production server hosting which seems to strip down the authorization header for some reason, but unity seems to send the authorization header.