flex/flash‎ > ‎

flex headers

Problem
In AIR, on a Mac, the flex HTTPService call changes the custom headers on HTTP requests to first character cap. For example this:
headers[ "alllowercaseheader" ] = "the header that I set";
is actually this:
headers[ "Alllowercaseheader" ] = "the header that I set";
BUT, only on a Mac. So if you develop/debug on a Windows box you will NEVER see the problem, but your Mac users will be sending different headers.

Solution:
There are two solutions, and while you may think that its "either/or", you should really do the server solution if you can.
First, in your AIR code, set the first char of the header as a cap, so do this:
headers[ "Alllowercaseheader" ] = "the header that I set";
That way Mac and windows boxes will generate the same header.
If you can, you should turn all of your headers into all lowercase on the server. So if you control the API, then set the header logic to convert to all lowercase.

Comments