Today, colleagues encountered a problem, we have two applications, a background application, mainly for the operation of editorial articles, published to the official website; a picture server application, many other applications uploaded images will be stored here, but also provide some query and management API.
The former is deployed in Backend.domain.com, while the latter is deployed in picture.domain.com.
Background app when uploading, use the upload plugin used by the upload technology for Flash.
After reviewing the data, test it locally.
1, My Computer launches the picture application locally, the application's root directory is delegated the following configuration file:
<?XML version= "1.0"?><Cross-domain-policy> <Allow-access-fromDomain= "192.168.2.18" /> <!--<allow-access-from domain= "*"/> - <Allow-http-request-headers-fromDomain="*"Headers="*" /></Cross-domain-policy>
2. Result: Access request cannot come in.
3. Modify the contents of the file as follows:
<?XML version= "1.0"?><Cross-domain-policy> <!--<allow-access-from domain= "192.168.2.18"/> - <Allow-access-fromDomain="*" /> <Allow-http-request-headers-fromDomain="*"Headers="*" /></Cross-domain-policy>
4, access to normal.
5. When a local breakpoint views the request, it discovers
String referer = Request.getheader ("Referer");
The result is http://localhost/*****, so the feeling may be because the colleague in his local use localhost to access the pot.
Let colleagues in his local browser do not use localhost access, instead of using his own LAN IP access, the request was finally successful.
Flash upload file, how to solve cross-domain issues