Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

URLLoader on iOS: url with basic auth leads to error #2032

Open Passenger747 opened this issue 3 years ago • 0 comments

Since i updated my app (from SDK version 33.1.1.795) to latest version 33.1.1.929, the URLLoader no longer works properly:

When an url is called which is protected by basic authentication, I always get an Error (#2032: Stream Error)

However, according to the AS3 API Reference the httpResponseStatus should be called (before any error), which returns the http status code. If the code is 401, it tells me that I need to open a login prompt window so that when I call the url again, the entered login data can be written into the requestHeader. This always worked correctly before the update.

Has anyone already noticed a similar problem?

Here's the code:

public function doRequest():void {
	var fileRequest:URLRequest = new URLRequest("https...url-with-basic-auth...");
	fileRequest.authenticate = false;
	var myLoader:URLLoader = new URLLoader();
	myLoader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpResponseStatus);
	myLoader.addEventListener(IOErrorEvent.IO_ERROR, ErrorHandler);
	myLoader.load(fileRequest);
}
		
public function httpResponseStatus( e : HTTPStatusEvent ) : void  {
	trace(e.toString());
}

private function ErrorHandler( e : IOErrorEvent ) : void  {
	trace(e.toString());
}

Passenger747 avatar Aug 22 '22 14:08 Passenger747