зеркало из https://github.com/mozilla/makedrive.git
Add ALLOW_CORS_DOMAINS env to .travis.yml file
This commit is contained in:
Родитель
e8b990dccc
Коммит
5eae612a34
|
@ -1,5 +1,5 @@
|
|||
env:
|
||||
- "PORT=3000 NODE_ENV=\"development\" ENABLE_GELF_LOGS=false SESSION_SECRET=\"secret value\" FORCE_SSL=false LOGIN_SERVER_URL_WITH_AUTH=\"http://localhost:3000\""
|
||||
- "PORT=3000 ALLOWED_CORS_DOMAINS=\"http://localhost:5001\" NODE_ENV=\"development\" ENABLE_GELF_LOGS=false SESSION_SECRET=\"secret value\" FORCE_SSL=false LOGIN_SERVER_URL_WITH_AUTH=\"http://localhost:3000\""
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
var expect = require('chai').expect;
|
||||
var request = require('request');
|
||||
var util = require('../lib/util');
|
||||
var env = require('../../server/lib/environment');
|
||||
var ALLOW_DOMAINS = process.env.ALLOWED_CORS_DOMAINS || env.get("ALLOWED_CORS_DOMAINS");
|
||||
|
||||
describe('[HTTP route tests]', function() {
|
||||
it('should allow CORS access to /api/sync route', function(done) {
|
||||
request.get('http://localhost:9090/api/sync', function(req, res, body) {
|
||||
expect(res.headers['access-control-allow-origin']).to.be.eql('*');
|
||||
expect(res.headers['access-control-allow-origin']).to.be.eql(ALLOW_DOMAINS);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче