Skip to content

cmd/stripes: fetch plain http(s) URLs directly so root URLs and redirects work#45

Open
achille-roussel wants to merge 1 commit into
mainfrom
fix-http-url
Open

cmd/stripes: fetch plain http(s) URLs directly so root URLs and redirects work#45
achille-roussel wants to merge 1 commit into
mainfrom
fix-http-url

Conversation

@achille-roussel

Copy link
Copy Markdown
Contributor

Problem

$ stripes http://localhost:8080/
Error: invalid object key ()

stripes fetches inputs through tigerblock's storage.GetObject, which models http(s) as an S3-style object store keyed by the request path. For http://localhost:8080/ the object key is empty (the path is just /), so the storage layer rejects it with invalid object key ()before any HTTP request is made. As a result the server's 302 redirect was never issued or followed either.

Fix

Route http(s):// arguments through a direct net/http GET (openInput / fetchHTTP) instead of the object-store abstraction. This:

  • works for keyless root URLs (http://host/),
  • follows redirects and renders the final response,
  • surfaces the final response's Content-Type / Content-Encoding for format detection,
  • still honours the auth transport installed by --basic-auth / --bearer-token,
  • turns non-2xx responses into errors so an error page isn't rendered as data.

Every other scheme (s3, gs, file, …) and bare filesystem paths continue to go through tigerblock storage unchanged.

Tests

  • New testdata/script/remote_http_root_redirect.txtar hits a root URL that 302-redirects to a JSON endpoint and asserts the rendered body.
  • The test server gains / (302) and /redirected/data.json handlers.
  • Existing http tests (basic auth, bearer, protobuf, OTLP) still pass through the new direct-fetch path.

🤖 Generated with Claude Code

…ects work

`stripes http://host/` failed with "invalid object key ()": tigerblock's
storage layer models http(s) as an S3-style object store keyed by the
request path, so a root URL (empty key) was rejected before any request
was made — and the storage path never followed the server's redirect.

Route http(s):// arguments through a direct net/http GET instead. This
works for keyless root URLs, follows redirects, and renders the final
response, while honouring the auth transport installed for --basic-auth
/ --bearer-token. Every other scheme (s3, gs, file, …) and bare paths
still go through tigerblock storage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant