Repository navigation
Web UI: fix download failing with authentication error - #108974
alexey-milovidov wants to merge 1 commit into
Conversation
Downloading a result in `play.html` failed with: Code: 516. DB::Exception: Invalid authentication: it is not allowed to use Authorization HTTP header and authentication via parameters simultaneously. (AUTHENTICATION_FAILED) The download used a hidden `<form>` POST submit, which cannot set request headers. When the browser had cached Basic-auth credentials it attached an `Authorization` header to the submit, which conflicted with the `user`/`password` URL parameters the page also adds. Every other request in the page already avoids this by sending the `Authorization: never` header via `fetch` to suppress the cached credentials. Switch the download to the same mechanism: `fetch` the result with `Authorization: never` and save the response blob via an object URL. Errors are now surfaced to the user instead of silently navigating the hidden form. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [a3f2052] AI ReviewSummaryThe PR fixes Missing context / blind spots
Findings
Tests
Final VerdictStatus: Minimum required actions: address the large-download buffering regression and add focused browser/manual evidence for the cached Basic-auth download path. |
| return; | ||
| } | ||
|
|
||
| const blob = await response.blob(); |
There was a problem hiding this comment.
await response.blob() only completes after the full response has been read, and only then does the synthetic anchor start the file download; large exports that the previous form path streamed directly to the browser can now consume browser memory/temp storage and fail before the user gets a file.
Please preserve a streaming download path or add an explicit size/streaming strategy for the fetch path, so fixing cached Basic-auth credentials does not regress large result downloads.
|
Superseded by #108980, which fixes the root cause on the server side instead. Rather than switching the download to |
Downloading a query result in the Web UI (
play.html) failed with:The download used a hidden
<form>POST submit, which cannot set request headers. When the browser had cached Basic-auth credentials, it attached anAuthorizationheader to the submit, which conflicted with theuser/passwordURL parameters the page also adds — so the server rejected the request.Every other request in the page already avoids this by sending the
Authorization: neverheader viafetchto suppress the cached credentials. This change switches the download to the same mechanism:fetchthe result withAuthorization: neverand save the response blob via an object URL. As a bonus, download errors are now surfaced to the user instead of silently navigating a hidden form.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Web UI (
play.html): fix downloading a result failing withAUTHENTICATION_FAILED(error 516) when the browser holds cached Basic-auth credentials.Documentation entry for user-facing changes
🤖 Generated with Claude Code