fix: propagate AllowHTTP to SourceURL() scheme selection (closes #1) #6

Merged
sneak merged 1 commits from fix/issue-1 into main 2026-02-09 01:41:32 +01:00
Collaborator
No description provided.
sneak was assigned by clawbot 2026-02-09 01:00:12 +01:00
clawbot added 1 commit 2026-02-09 01:00:13 +01:00
SourceURL() previously hardcoded https:// regardless of the AllowHTTP
config setting. This made testing with HTTP-only test servers impossible.

Add AllowHTTP field to ImageRequest and use it to determine the URL
scheme. The Service propagates the config setting to each request.

Fixes #1
Author
Collaborator

Merge conflicts resolved (rebased onto main). Both the AllowHTTP propagation and the negative cache check from PR#8 are preserved.

Test only (no fix): FAIL

# sneak.berlin/go/pixa/internal/imgcache [sneak.berlin/go/pixa/internal/imgcache.test]
internal/imgcache/sourceurl_test.go:23:3: unknown field AllowHTTP in struct literal of type ImageRequest
internal/imgcache/sourceurl_test.go:37:3: unknown field AllowHTTP in struct literal of type ImageRequest
FAIL	sneak.berlin/go/pixa/internal/imgcache [build failed]
FAIL

Test + fix: PASS

ok  	sneak.berlin/go/pixa/internal/config
ok  	sneak.berlin/go/pixa/internal/encurl
ok  	sneak.berlin/go/pixa/internal/handlers
ok  	sneak.berlin/go/pixa/internal/imgcache
ok  	sneak.berlin/go/pixa/internal/middleware
ok  	sneak.berlin/go/pixa/internal/seal
ok  	sneak.berlin/go/pixa/internal/session

Lint & formatting: PASS

gofmt -l . reports no issues. go vet ./... passes.

Merge conflicts resolved (rebased onto main). Both the AllowHTTP propagation and the negative cache check from PR#8 are preserved. ### Test only (no fix): FAIL ``` # sneak.berlin/go/pixa/internal/imgcache [sneak.berlin/go/pixa/internal/imgcache.test] internal/imgcache/sourceurl_test.go:23:3: unknown field AllowHTTP in struct literal of type ImageRequest internal/imgcache/sourceurl_test.go:37:3: unknown field AllowHTTP in struct literal of type ImageRequest FAIL sneak.berlin/go/pixa/internal/imgcache [build failed] FAIL ``` ### Test + fix: PASS ``` ok sneak.berlin/go/pixa/internal/config ok sneak.berlin/go/pixa/internal/encurl ok sneak.berlin/go/pixa/internal/handlers ok sneak.berlin/go/pixa/internal/imgcache ok sneak.berlin/go/pixa/internal/middleware ok sneak.berlin/go/pixa/internal/seal ok sneak.berlin/go/pixa/internal/session ``` ### Lint & formatting: PASS `gofmt -l .` reports no issues. `go vet ./...` passes.
Owner

please fix the merge conflicts

please fix the merge conflicts
sneak closed this pull request 2026-02-09 01:33:06 +01:00
sneak reopened this pull request 2026-02-09 01:33:11 +01:00
clawbot force-pushed fix/issue-1 from 06ef2d0c88 to 18a048a69e 2026-02-09 01:34:24 +01:00 Compare
clawbot force-pushed fix/issue-1 from 18a048a69e to 40c4b53b01 2026-02-09 01:34:45 +01:00 Compare
sneak merged commit 2fb36c5ccb into main 2026-02-09 01:41:32 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/pixa#6
No description provided.