Browse Source

Check imager message origin

pull/126/head
Lal'C Mellk Mal 2 years ago
parent
commit
69cc091ee1
2 changed files with 10 additions and 1 deletions
  1. +5
    -0
      client/posting.js
  2. +5
    -1
      imager/config.js.example

+ 5
- 0
client/posting.js View File

@@ -1010,6 +1010,11 @@ dispatcher[IMAGE_STATUS] = function (msg) {
};

window.addEventListener('message', function (event) {
var uploadOrigin = imagerConfig.UPLOAD_ORIGIN;
if (uploadOrigin && uploadOrigin != '*') {
if (event.origin && event.origin !== uploadOrigin)
return;
}
var msg = event.data;
if (msg == 'OK')
return;


+ 5
- 1
imager/config.js.example View File

@@ -12,11 +12,15 @@ module.exports = {
tmp: 'imager/tmp',
},
MEDIA_URL: '../',
UPLOAD_URL: null,
UPLOAD_URL: '../upload/',

// this should be the same as location.origin
// in your browser's javascript console
MAIN_SERVER_ORIGIN: 'http://localhost:8000',
// this is the origin of upload_url
// (usually this will be the same as the main server origin,
// or maybe a different subdomain)
UPLOAD_ORIGIN: 'http://localhost:8000',

PINKY_QUALITY: 50,
PINKY_DIMENSIONS: [125, 125],


Loading…
Cancel
Save