cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miquel (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-10281) Allow CORS
Date Wed, 30 Dec 2015 10:07:49 GMT
Miquel created CB-10281:
---------------------------

             Summary: 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
             Fix For: Master


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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message