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
2 people authored and weslley543 committed Jul 8, 2022
1 parent e53ec85 commit d3f464a
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 d3f464a

Please sign in to comment.