Repository navigation
fix(karakeep): report the HTTP status when saving an entry fails - #4520
Merged
Merged
Conversation
SaveURL rejected the response on its Content-Type before it looked at the status code, so any error the server returned as HTML (a reverse proxy 502, an auth redirect, a wrong endpoint) surfaced as "unexpected content type response: text/html; charset=utf-8" with no mention of the status. Users had nothing to act on. The check was also the only one of its kind in internal/integration: every other client, including attachTags in this same file, decides on the status code alone and lets json.Unmarshal report a body it cannot read. Drop it so a failed save names its status.
dsh2dsh
added a commit
to dsh2dsh/miniflux
that referenced
this pull request
Oct 11, 2026
Discard miniflux#4401 Partly apply miniflux#4520 (tests)
dsh2dsh
added a commit
to dsh2dsh/miniflux
that referenced
this pull request
Oct 11, 2026
Backports changes from miniflux#4520
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #4477 — Unable to send entries to Karakeep.
Problem
SaveURLcheckedContent-Typebefore the HTTP status. HTML error pages from a proxy, redirect, or incorrect endpoint therefore surfaced only as an unexpected content type, hiding the status that explains the failure.Fix
Remove the one-off content-type gate and follow the integration package's existing status-first pattern. Non-201 responses now report their status; successful responses still have to decode as the expected JSON payload.
Deliberately not done
This improves the diagnostic but does not change private-network policy or deployment configuration. Installations targeting a private Karakeep address may still need
INTEGRATION_ALLOW_PRIVATE_NETWORKS=1.User impact
Failed saves now expose the upstream HTTP status, making proxy, authentication, and endpoint problems actionable instead of reporting only
text/html.Verification
go test ./internal/integration/...— all integration packages passed.go vet ./...— passed.go build ./...— passed.git diff --checkandgofmt -d— clean.I have tested my changes
There are no breaking changes
I have thoroughly tested my changes and verified there are no regressions
My commit messages follow the Conventional Commits specification
I have read and understood the contribution guidelines