1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-13 08:31:59 +00:00

Rename heisenbergCompensator -> modifiedOptions

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-01-29 19:17:04 +01:00
parent 4322299c39
commit 6e0b16ed1a
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -601,7 +601,7 @@ compareLists() {
# Download specified URL and perform checks on HTTP status and file content
gravity_DownloadBlocklistFromUrl() {
local url="${1}" adlistID="${2}" saveLocation="${3}" target="${4}" compression="${5}" gravity_type="${6}" domain="${7}"
local heisenbergCompensator="" listCurlBuffer str httpCode success="" ip cmd_ext
local modifiedOptions="" listCurlBuffer str httpCode success="" ip cmd_ext
local file_path permissions ip_addr port blocked=false download=true
# Create temp file to store content on disk instead of RAM
@ -619,14 +619,14 @@ gravity_DownloadBlocklistFromUrl() {
# Save HTTP ETag to the specified file. An ETag is a caching related header,
# usually returned in a response. If no ETag is sent by the server, an empty
# file is created and can later be used consistently.
heisenbergCompensator="--etag-save ${saveLocation}.etag"
modifiedOptions="--etag-save ${saveLocation}.etag"
if [[ -f "${saveLocation}.etag" ]]; then
# This option makes a conditional HTTP request for the specific ETag read
# from the given file by sending a custom If-None-Match header using the
# stored ETag. This way, the server will only send the file if it has
# changed since the last request.
heisenbergCompensator="${heisenbergCompensator} --etag-compare ${saveLocation}.etag"
modifiedOptions="${modifiedOptions} --etag-compare ${saveLocation}.etag"
fi
fi
@ -639,7 +639,7 @@ gravity_DownloadBlocklistFromUrl() {
# Interstingly, this option is not supported by raw.githubusercontent.com
# URLs, however, it is still supported by many older web servers which may
# not support the HTTP ETag method so we keep it as a fallback.
heisenbergCompensator="${heisenbergCompensator} -z ${saveLocation}"
modifiedOptions="${modifiedOptions} -z ${saveLocation}"
fi
fi
@ -770,7 +770,7 @@ gravity_DownloadBlocklistFromUrl() {
if [[ "${download}" == true ]]; then
# shellcheck disable=SC2086
httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${heisenbergCompensator} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2>/dev/null)
httpCode=$(curl --connect-timeout ${curl_connect_timeout} -s -L ${compression} ${cmd_ext} ${modifiedOptions} -w "%{http_code}" "${url}" -o "${listCurlBuffer}" 2>/dev/null)
fi
case $url in