Skip to content

Commit

Permalink
Only take the origin without the ? and after
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoJokhan committed Jun 28, 2023
1 parent 7049eef commit 4092885
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cms/lib/modules/openstad-global/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ module.exports = (self, options) => {
self.translate = async (req, res) => {
const deeplAuthKey = options.deeplKey;
const content = req.body.contents;
const origin = req.body.origin;
let origin = req.body.origin;
const sourceLanguageCode = req.body.sourceLanguageCode;
const destinationLanguage = req.body.targetLanguageCode;

if(origin) {
origin = origin.split('?')[0];
}

const cacheKey = crypto.createHash('sha256').update(`${destinationLanguage}${origin}${JSON.stringify(content)}`).digest('hex');

if (!origin) {
Expand Down

1 comment on commit 4092885

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/frontend:bugfix-stricter-origin-on-cachkey-4092885

Please sign in to comment.