mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
comment out Accept-Encoding header (#363)
* comment out Accept-Encoding header because it can cause issues when it includes a compression algorithm that requests doesn't support * update tests
This commit is contained in:
committed by
GitHub
parent
6a43531ec4
commit
6513ea5dc9
2
fixtures/python/get_with_browser_headers.py
generated
2
fixtures/python/get_with_browser_headers.py
generated
@@ -10,7 +10,7 @@ cookies = {
|
||||
}
|
||||
|
||||
headers = {
|
||||
'Accept-Encoding': 'gzip, deflate, sdch',
|
||||
# 'Accept-Encoding': 'gzip, deflate, sdch',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
||||
|
||||
2
fixtures/python/options.py
generated
2
fixtures/python/options.py
generated
@@ -4,7 +4,7 @@ headers = {
|
||||
'Pragma': 'no-cache',
|
||||
'Access-Control-Request-Method': 'POST',
|
||||
'Origin': 'https://alexa.amazon.de',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
# 'Accept-Encoding': 'gzip, deflate, br',
|
||||
'Accept-Language': 'de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
|
||||
'Accept': '*/*',
|
||||
|
||||
2
fixtures/python/post_data_binary_with_equals.py
generated
2
fixtures/python/post_data_binary_with_equals.py
generated
@@ -19,7 +19,7 @@ headers = {
|
||||
# Requests sorts cookies= alphabetically
|
||||
# 'Cookie': 'X-BackEndCookie=S-1-5-21-1234556-56678-12345-2345=alphanumericstring12345/anotheralphanumericstring12345/scsiAdf/P; ClientId=LoremIupsum; PrivateComputer=true;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dwhoo/rga4s4Dc2UsJLQ8c0yGlZgflYs+7Q5gPr74/mTUin60ej/w3M0roUl3FQ==; UC=d8be544621964f3c9865b3ee872fd432; AppcacheVer=15.0.1236.3:en-usbase; X-OWA-CANARY=VOXQP6xtGkiNnv7E4rFt8TrmclqVFtQI4IJqZflrR7Wz9AMPkMsFoyAlquw1YGsTUxIkVouAcvk.',
|
||||
'Origin': 'https://nih.mail.edu.fr',
|
||||
'Accept-Encoding': 'gzip, deflate, br',
|
||||
# 'Accept-Encoding': 'gzip, deflate, br',
|
||||
'X-EWS-TargetVersion': '2.5',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36',
|
||||
|
||||
2
fixtures/python/post_with_browser_headers.py
generated
2
fixtures/python/post_with_browser_headers.py
generated
@@ -8,7 +8,7 @@ cookies = {
|
||||
|
||||
headers = {
|
||||
'Origin': 'http://www.w3schools.com',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
# 'Accept-Encoding': 'gzip, deflate',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
|
||||
'Accept': '*/*',
|
||||
|
||||
2
fixtures/python/post_with_urlencoded_data.py
generated
2
fixtures/python/post_with_urlencoded_data.py
generated
@@ -2,7 +2,7 @@ import requests
|
||||
|
||||
headers = {
|
||||
'Origin': 'http://fiddle.jshell.net',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
# 'Accept-Encoding': 'gzip, deflate',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
|
||||
@@ -2,7 +2,7 @@ import requests
|
||||
|
||||
headers = {
|
||||
'Origin': 'http://www.realtor.ca',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
# 'Accept-Encoding': 'gzip, deflate',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
|
||||
@@ -228,7 +228,10 @@ export const _toPython = request => {
|
||||
// Currently, only assuming that the env-var only used in
|
||||
// the value part of cookies, params, or body
|
||||
const osVariables = new Set()
|
||||
const commentedOutHeaders = { 'content-length': '' }
|
||||
const commentedOutHeaders = {
|
||||
'accept-encoding': '',
|
||||
'content-length': ''
|
||||
}
|
||||
// https://github.com/icing/blog/blob/main/curl_on_a_weekend.md
|
||||
if (util.getHeader(request, 'te') === 'trailers') {
|
||||
commentedOutHeaders.te = "Requests doesn't support trailers"
|
||||
|
||||
Reference in New Issue
Block a user