Skip to content

[internal.file] Don't strip the scheme from http(s):// file paths - #1432

Merged
manugarg merged 2 commits into
cloudprober:mainfrom
Synehan:fix/file-http
Sep 23, 2026
Merged

manugarg merged 2 commits into
cloudprober:mainfrom
Synehan:fix/file-http

Conversation

@Synehan

@Synehan Synehan commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #1431.

Stripping http:// and https:// with http.NewRequestWithContext generate error and makes file_target with http not working.

I have deported the stripping into each s3 and gcs functions.

I have also moved http functions to a specific file.

Build / Docker tested + live tested

Comment thread internal/file/file.go Resolved
Instead of moving prefix stripping into each backend, keep it in
ReadFile/ModTime and skip it for http:// and https://, which need the
full URL. Revert the http.go split and gcs/s3 changes, and add an
httptest-based test for ReadFile and ModTime over HTTP.
@manugarg manugarg changed the title [internal/http]: http:// should not be stripped down (#1431) [internal.file] Don't strip the scheme from http(s):// file paths Sep 23, 2026
@manugarg
manugarg merged commit b8cfd6a into cloudprober:main Sep 23, 2026
11 checks passed
@manugarg manugarg added this to the v0.14.6 milestone Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants