HTTP Basic Authentication with HTTPService Objects in Adobe Flex/AIR

前端 未结 8 1437
梦谈多话
梦谈多话 2020-12-04 14:52

I\'m trying to request a HTTP resource that requires basic authorization headers from within an Adobe AIR application. I\'ve tried manually adding the headers to the request

8条回答
  •  日久生厌
    2020-12-04 15:25

    Finally received some attention from Adobe and got an answer on this. The problem with long HTTP Authentication headers is that, by default, the Base64Encoder class will inject newline characters every 72 characters. Obviously that causes a chunk of the base-64 encoded string to be interpreted as a new header attribute, which causes the error.

    You can fix this by setting (in the above example) encoder.insertNewLines = false; The default setting is true.

    I've fixed the above code to work for arbitrarily long Authentication strings.

提交回复
热议问题