[ 
https://issues.apache.org/jira/browse/CB-10281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15076030#comment-15076030
 ] 

Miquel commented on CB-10281:
-----------------------------

I've developed a web app with angular 2 which was not working in my android 
default browser. As the default browser doesn't accept chrome developer tools I 
tried to use weinre. So I had weinre server in my local computer 
(192.168.1.130:8081) and implemented in production site (when debug flag was 
set: http://diasbajalaboral.com ?DEBUG=true - right now weinre is not 
implemented). This way I could test with my Android device in local network 
navigating to production site in default browser.
Without this modification I could not download the script on my Android default 
browser from weinre local network and make it work.

I'm not really experienced in CoffeeSript, this is the reason I haven't 
modified src.
If you think it's worth, I'll try my best on CoffeeScript. However, any help if 
it's wrong would be really appreciated :)
Otherwise I can cancel the PR.

> Allow CORS
> ----------
>
>                 Key: CB-10281
>                 URL: https://issues.apache.org/jira/browse/CB-10281
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: weinre
>    Affects Versions: 3.5.0
>            Reporter: Miquel
>            Assignee: Patrick Mueller
>            Priority: Minor
>              Labels: easyfix, features, patch
>             Fix For: Master
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> I've created a pull request to allow CORS:
> https://github.com/apache/cordova-weinre/pull/10:
> {noformat}
> diff --git a/weinre.server/lib/weinre.js b/weinre.server/lib/weinre.js
> index a4ca11c..036df78 100644
> --- a/weinre.server/lib/weinre.js
> +++ b/weinre.server/lib/weinre.js
> @@ -133,6 +133,11 @@ startServer = function() {
>    });
>    app.use(express.favicon(favIcon));
>    app.use(jsonBodyParser());
> +  app.use(function(req, res, next) {
> +    res.header("Access-Control-Allow-Origin", "*");
> +    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, 
> Content-Type, Accept");
> +    next();
> +  });
>    app.all(/^\/ws\/client(.*)/, function(request, response, next) {
>      var uri;
>      uri = request.params[0];
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to