Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #12780: Do not store response when response code is an error in file_fom_http_server #1103

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tree/30_generic_methods/file_from_http_server.cf
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
# @description Download a file if it does not exist, using curl with a fallback on wget
# @documentation This method finds a HTTP command-line tool and downloads the given source
# into the destination.
#
#
# This method **will NOT update the file after the first download** until its removal.
#
# It tries `curl` first, and `wget` as fallback.
#
# @parameter source URL to download from
# @parameter destination File destination (absolute path on the target node)
#
# @parameter destination File destination (absolute path on the target node)
#
# @class_prefix file_from_http_server
# @class_parameter destination

Expand All @@ -36,7 +38,7 @@ bundle agent file_from_http_server(source, destination)


_ncf_path_exists_curl::
"action_command" string => "${ncf_paths.path[curl]} -s -L -o ${destination} ${source}";
"action_command" string => "${ncf_paths.path[curl]} -f -s -L -o ${destination} ${source}";


!_ncf_path_exists_curl._stdlib_path_exists_wget::
Expand Down