[jbosstools-issues] [JBoss JIRA] (JBIDE-14652) CordovaSim: cross-origin requests send default user agent string in headers
Yahor Radtsevich (JIRA)
jira-events at lists.jboss.org
Mon May 27 08:18:07 EDT 2013
[ https://issues.jboss.org/browse/JBIDE-14652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yahor Radtsevich updated JBIDE-14652:
-------------------------------------
Description:
Cross-origin XMLHttpRequest send browser's default User Agent string in the request headers.
*Steps to reproduce:*
Create the following page in a hybrid project and open it with CordovaSim:
{code:xml|title=ua-test.html}
<script>
var client = new XMLHttpRequest();
client.onreadystatechange = function() {
if(client.readyState == client.DONE) {
if (client.status == 200) {
alert(/<span id="body_lbUserAgent">([^>]*)<\/span>/ig.exec(client.responseText)[1]);
} else {
alert("Error code: " + client.status);
}
}
}
client.open("GET", "http://www.whatsmyuseragent.com/");
client.send();
</script>
{code}
*Actual result:*
A desktop User Agent is shown:
!ua-actual-result.png|thumbnail!
*Expected result:*
An iPhone User Agent is shown.
was:
Cross-origin XMLHttpRequest send browser's default User Agent string in the request headers.
*Steps to reproduce:*
Create the following page in a hybrid project and open it with CordovaSim:
{code:xml|title=ua-test.html}
<script>
var client = new XMLHttpRequest();
client.onreadystatechange = function() {
if(client.readyState == client.DONE) {
if (client.status == 200) {
alert(/<span id="body_lbUserAgent">([^>]*)<\/span>/ig.exec(client.responseText)[1]);
} else {
alert("Error code: " + client.status);
}
}
}
client.open("GET", "http://www.whatsmyuseragent.com/");
client.send();
</script>
{code}
*Actual result:*
!ua-actual-result.png|thumbnail!
*Expected result:*
An iPhone User Agent is showed.
> CordovaSim: cross-origin requests send default user agent string in headers
> ---------------------------------------------------------------------------
>
> Key: JBIDE-14652
> URL: https://issues.jboss.org/browse/JBIDE-14652
> Project: Tools (JBoss Tools)
> Issue Type: Feature Request
> Affects Versions: 4.1.0.Beta1
> Reporter: Yahor Radtsevich
> Assignee: Yahor Radtsevich
> Fix For: 4.1.0.Beta2
>
> Attachments: ua-actual-result.png
>
>
> Cross-origin XMLHttpRequest send browser's default User Agent string in the request headers.
> *Steps to reproduce:*
> Create the following page in a hybrid project and open it with CordovaSim:
> {code:xml|title=ua-test.html}
> <script>
> var client = new XMLHttpRequest();
> client.onreadystatechange = function() {
> if(client.readyState == client.DONE) {
> if (client.status == 200) {
> alert(/<span id="body_lbUserAgent">([^>]*)<\/span>/ig.exec(client.responseText)[1]);
> } else {
> alert("Error code: " + client.status);
> }
> }
> }
> client.open("GET", "http://www.whatsmyuseragent.com/");
> client.send();
> </script>
> {code}
> *Actual result:*
> A desktop User Agent is shown:
> !ua-actual-result.png|thumbnail!
> *Expected result:*
> An iPhone User Agent is shown.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list