Merge pull request #5 from lwthiker/use_compressed

Use --compressed flag by default
This commit is contained in:
lwthiker
2022-02-19 09:39:37 +02:00
committed by GitHub
2 changed files with 4 additions and 36 deletions

View File

@@ -3,11 +3,6 @@
# Find the directory of this script # Find the directory of this script
dir=`echo "$0" | sed 's%/[^/]*$%%'` 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 # The list of ciphers can be obtained by looking at the Client Hello message in
# Wireshark, then converting it using the cipherlist array at # Wireshark, then converting it using the cipherlist array at
# https://github.com/curl/curl/blob/master/lib/vtls/nss.c # 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-Mode: navigate' \
-H 'Sec-Fetch-Site: none' \ -H 'Sec-Fetch-Site: none' \
-H 'Sec-Fetch-User: ?1' \ -H 'Sec-Fetch-User: ?1' \
--http2 --false-start \ --http2 --false-start --compressed \
$@ >&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

View File

@@ -3,11 +3,6 @@
# Find the directory of this script # Find the directory of this script
dir=`echo "$0" | sed 's%/[^/]*$%%'` 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 # The list of ciphers can be obtained by looking at the Client Hello message in
# Wireshark, then converting it using the cipherlist array at # Wireshark, then converting it using the cipherlist array at
# https://github.com/curl/curl/blob/master/lib/vtls/nss.c # 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-Mode: navigate' \
-H 'Sec-Fetch-Site: none' \ -H 'Sec-Fetch-Site: none' \
-H 'Sec-Fetch-User: ?1' \ -H 'Sec-Fetch-User: ?1' \
--http2 --false-start \ --http2 --false-start --compressed \
$@ >&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