Skip to content

Commit

Permalink
Make sure Python compression handling isn't case-sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Apr 8, 2024
1 parent 9db7400 commit 9c5b81f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/targets/python/python3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'use strict'

const CodeBuilder = require('../../helpers/code-builder')
const helpers = require('../../helpers/headers')

module.exports = function (source, options) {
const code = new CodeBuilder()
Expand All @@ -26,8 +27,8 @@ module.exports = function (source, options) {
code.push('import ssl')
}

const mayBeGzipped = source.allHeaders['accept-encoding'] &&
source.allHeaders['accept-encoding'].includes('gzip')
const mayBeGzipped = helpers.hasHeader(source.allHeaders, 'accept-encoding') &&
helpers.getHeader(source.allHeaders, 'accept-encoding').includes('gzip')

if (mayBeGzipped) {
code.push('import gzip')
Expand Down

0 comments on commit 9c5b81f

Please sign in to comment.