Merge branch 'master' of wopr.rodax-software.com:lqdvi/app2-api

This commit is contained in:
David Arranz 2019-09-09 12:06:57 +02:00
commit d96fd80921
2 changed files with 8 additions and 3 deletions

View File

@ -43,15 +43,20 @@ app.use(methodOverride());
app.use(helmet());
// enable CORS - Cross Origin Resource Sharing
var allowedOrigins = ['http://localhost:8080', 'http://127.0.0.1:8080', 'https://adminapp2.loquedeverdadimporta.org'];
var allowedOrigins = ['http://localhost:8080', 'http://127.0.0.1:8080', 'https://adminapp2.loquedeverdadimporta.org'];
app.use(cors({
origin: function (origin, callback) { // allow requests with no origin
origin: function (origin, callback) {
// allow requests with no origin
// (like mobile apps or curl requests)
return callback(null, true);
if (!origin) {
return callback(null, true);
}
console.log('origin =>', origin);
if (allowedOrigins.indexOf(origin) === -1) {
var msg = 'The CORS policy for this site does not ' +
'allow access from the specified Origin.';

View File

@ -43,7 +43,7 @@ function extractVimeoInformation(vimeoResponse) {
link: vimeoResponse.link,
type: vimeoResponse.type,
stats: vimeoResponse.stats,
files: vimeoResponse.files,
download: vimeoResponse.download,
pictures: vimeoResponse.pictures,
embed: getIframeSource(vimeoResponse.embed.html)