change location of jwt when uploading image from link to query string, to prevent problems with IIS URL Rewrite

This commit is contained in:
Sergey Konovalov
2017-12-13 17:31:35 +03:00
parent cfa138960e
commit 49180649af
2 changed files with 4 additions and 4 deletions

View File

@ -124,7 +124,7 @@ exports.uploadImageFileOld = function(req, res) {
logger.debug('Start uploadImageFileOld: docId = %s', docId);
var userid = req.params.userid;
if (cfgTokenEnableBrowser) {
var checkJwtRes = checkJwtUpload(docId, 'uploadImageFileOld', req.params.jwt);
var checkJwtRes = checkJwtUpload(docId, 'uploadImageFileOld', req.query['token']);
if(!checkJwtRes.err){
docId = checkJwtRes.docId || docId;
userid = checkJwtRes.userid || userid;
@ -211,7 +211,7 @@ exports.uploadImageFile = function(req, res) {
var isValidJwt = true;
if (cfgTokenEnableBrowser) {
var checkJwtRes = checkJwtUpload(docId, 'uploadImageFile', req.params.jwt);
var checkJwtRes = checkJwtUpload(docId, 'uploadImageFile', req.query['token']);
if (!checkJwtRes.err) {
docId = checkJwtRes.docId || docId;
userid = checkJwtRes.userid || userid;

View File

@ -221,8 +221,8 @@ if (cluster.isMaster) {
res.sendStatus(403);
}
});
app.post('/uploadold/:docid/:userid/:index/:jwt?', fileUploaderService.uploadImageFileOld);
app.post('/upload/:docid/:userid/:index/:jwt?', rawFileParser, fileUploaderService.uploadImageFile);
app.post('/uploadold/:docid/:userid/:index', fileUploaderService.uploadImageFileOld);
app.post('/upload/:docid/:userid/:index', rawFileParser, fileUploaderService.uploadImageFile);
app.post('/downloadas/:docid', rawFileParser, canvasService.downloadAs);
app.get('/healthcheck', utils.checkClientIp, docsCoServer.healthCheck);