From 43b74105e56db6c27b2255c58c22850765ad8f11 Mon Sep 17 00:00:00 2001 From: lwthiker Date: Sat, 19 Feb 2022 09:37:20 +0200 Subject: [PATCH] Use --compressed flag by default Because we send the 'Accept-Encoding: gzip, deflate, br' header we may receive compressed content (gzip or brotli). Previously this was handled manually in the wrapper script, however curl has a '--compressed' flag exactly for that purpose. Add it by default to the wrapper scripts. --- curl_ff91esr | 20 ++------------------ curl_ff95 | 20 ++------------------ 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/curl_ff91esr b/curl_ff91esr index c73aa30..870e446 100755 --- a/curl_ff91esr +++ b/curl_ff91esr @@ -3,11 +3,6 @@ # Find the directory of this script dir=`echo "$0" | sed 's%/[^/]*$%%'` -PIPE=/tmp/curl-pipe - -rm -f "$PIPE" && mkfifo "$PIPE" -exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- - # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using the cipherlist array at # https://github.com/curl/curl/blob/master/lib/vtls/nss.c @@ -23,16 +18,5 @@ exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- -H 'Sec-Fetch-Mode: navigate' \ -H 'Sec-Fetch-Site: none' \ -H 'Sec-Fetch-User: ?1' \ - --http2 --false-start \ - $@ >&3 - -exec 3>&- - -IFS= read -d '' -r -n 2 -u 4 header - -# Due to the "Accept-Encoding: gzip" header, we may receive a gzipped file. -if [ "$(echo -n $header | xxd -l 2 -p)" == "1f8b" ]; then - (printf "%s" "$header"; cat <&4) | gzip -cd; -else - printf "%s" "$header"; cat <&4; -fi + --http2 --false-start --compressed \ + $@ diff --git a/curl_ff95 b/curl_ff95 index b175729..15b2074 100755 --- a/curl_ff95 +++ b/curl_ff95 @@ -3,11 +3,6 @@ # Find the directory of this script dir=`echo "$0" | sed 's%/[^/]*$%%'` -PIPE=/tmp/curl-pipe - -rm -f "$PIPE" && mkfifo "$PIPE" -exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- - # The list of ciphers can be obtained by looking at the Client Hello message in # Wireshark, then converting it using the cipherlist array at # https://github.com/curl/curl/blob/master/lib/vtls/nss.c @@ -23,16 +18,5 @@ exec 5<>"$PIPE" 3>"$PIPE" 4<"$PIPE" 5>&- -H 'Sec-Fetch-Mode: navigate' \ -H 'Sec-Fetch-Site: none' \ -H 'Sec-Fetch-User: ?1' \ - --http2 --false-start \ - $@ >&3 - -exec 3>&- - -IFS= read -d '' -r -n 2 -u 4 header - -# Due to the "Accept-Encoding: gzip" header, we may receive a gzipped file. -if [ "$(echo -n $header | xxd -l 2 -p)" == "1f8b" ]; then - (printf "%s" "$header"; cat <&4) | gzip -cd; -else - printf "%s" "$header"; cat <&4; -fi + --http2 --false-start --compressed \ + $@