Skip to content

Commit

Permalink
Merge pull request #157 from humanmade/fix/webp-header-case
Browse files Browse the repository at this point in the history
Allow a case-insensitive X-WebP header
  • Loading branch information
kovshenin authored Mar 3, 2023
2 parents 70aa2ce + 71551cb commit eab2342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lambda-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.handler = function(event, context, callback) {
key = key.replace( '/uploads/tachyon/', '/uploads/' );
var args = event.queryStringParameters || {};
if ( typeof args.webp === 'undefined' ) {
args.webp = !!(event.headers && event.headers['X-WebP']);
args.webp = !!(event.headers && Object.keys(event.headers).find(key => key.toLowerCase() == 'x-webp'));
}
return tachyon.s3({ region: region, bucket: bucket }, key, args, function(
err,
Expand Down

0 comments on commit eab2342

Please sign in to comment.