Skip to content

Commit

Permalink
Regression: Fix assets format (#26140)
Browse files Browse the repository at this point in the history
Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
  • Loading branch information
sampaiodiego and ggazzo authored Jul 5, 2022
1 parent f26dd61 commit dd2f597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/meteor/app/assets/server/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ const listener = Meteor.bindEnvironment((req: IncomingMessage, res: ServerRespon
const asset = getAssetByKey(params.asset);
const file = asset?.cache;

const format = req.url.split('.').pop() || '';
const format = req.url.replace(/.*\.([a-z]+)(?:$|\?.*)/i, '$1');

if (asset && Array.isArray(asset.constraints.extensions) && !asset.constraints.extensions.includes(format)) {
res.writeHead(403);
Expand Down

0 comments on commit dd2f597

Please sign in to comment.