This works fine in the Unity editor, desktop builds, and on Android devices, but this does not work on iOS. The authorization fails on iOS and nothing is returned. Has anyone seen anything similar to this?
I don’t think it’s IIS. I am pretty sure it’s not the web server though. The authorization header doesn’t appear on the incoming request when coming from an iOS device, but it does appear when coming from the unity editor or android.
The problem seems to be with setting the header on GET on iOS, not reading it.
That’s what I was looking to get at… trying to find out if the header was even being passed. Could be the Hashtable implementation is not working correctly in iOS.
for 4.3.3 we have pushed the total rewrite of WWW backend, so now GET headers should be handled properly. Can you please bug report with small repro project so we can check it? (just in case 4.3.3 is not yet released)
Thanks @Chris HG! I don’t have any problem with using WWW GET to set the Authorization header (other than on iOS/Webplayer) on 4.3.1. Haven’t tested on 4.3.2 or 4.3.3 yet but will do so soon.
I’ve posted the plugin / service I’ve been working on on this thread - the plugin can be downloaded on GitHub if anyone’s interested in taking a look.
Sorry for hijacking the thread,
WWW works fine in 4.3.3. I was checking www.error==null instead of IsNullOrEmpty(www.error).
Still no HTTP HEADER on response.
god, thanks for the update - you got me totally panicking
you mean status?
it is handled a bit differently (as in - ios handles it differently: it is removed from headers)
so first of all we DO handle it internally. Secondly - now you can totally tweak it if you want: check WWWConnection.mm in trampoline
look for
you can totally hijack your own processing if you need/want
(i would advise to subclass UnityWWWConnectionDelegate but you can do whatever, just make sure you dont break unity side ;-))
checking www.error with IsNullOrEmpty is a must in 4.3.3f
as in player it works by comparing www.error==null but on IOS it does not. Hope nobody spend so much time as I did on this.