tsbits Posted December 18, 2014 Share Posted December 18, 2014 Hello there, I'm currently using PIXI on a project ( as often because it's my favorite canvas framework ) and I have a little problem.I'm must work on a staging server protected by an htaccess login system ( BASIC AUTH ). When I try to load a texture with PIXI.Texture.fromImage() method, my calls returns a 401 (Authorization Required) HTTP error.But only on Chrome ( I'm running the version 39.0.2171.95 - 64 bits - Mac OSX ). If I try to load an image on the Chrome console after filling my auth data and load the page like that :var i = new Image();i.src="http://mypath/pict.jpg"It works. If I look at the call that Chrome does, in the request header I see an "Authorization" parameter :Authorization:Basic Y3JlYWt0a...That parameter is not in the header of the request generated by PIXI.Is there a way to pass auth data to PIXI ?Thanks. Quote Link to comment Share on other sites More sharing options...
JDW Posted December 18, 2014 Share Posted December 18, 2014 Hello, It is not possible, sorry. Check this out to see how people with similar problem did, but it doesn't seems to be a good solution for you : http://stackoverflow.com/questions/20617720/why-doesnt-the-browser-reuse-the-authorization-headers-after-an-authenticated-x Quote Link to comment Share on other sites More sharing options...
konsumer Posted December 22, 2014 Share Posted December 22, 2014 Does this work?i.src="http://USER:PASSWORD@mypath/pict.jpg" Quote Link to comment Share on other sites More sharing options...
modegames Posted December 23, 2014 Share Posted December 23, 2014 I found changing within the pixi source this line from image.crossOrigin = ''; to image.crossOrigin = 'use-credentials'; For me this fixes the issue on Chrome! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.