Repository navigation
Fix Gemini 415 on FPC: valid Content-Type, drop invalid Content-Encoding: utf-8 - #187
Merged
Merged
Conversation
…: utf-8' (FPC) The FPC/Indy request path set Http.Request.ContentEncoding := 'utf-8', emitting an invalid 'Content-Encoding: utf-8' header (Content-Encoding is for gzip/deflate/br/identity, not a charset). Anthropic and OpenAI ignore it, but Gemini's API strictly rejects the unknown content-coding with HTTP 415 Unsupported Media Type — so gemini/* POSTs (generateContent) failed on FPC builds, e.g. 'gemini error: status=415'. Fix all four Indy request sites (PostJSON, PutJSON, PostRaw, PostJSONToStream) to put the charset where it belongs — 'application/json; charset=utf-8' (and 'ContentType + ; charset=utf-8' for PostRaw) — and stop setting Content-Encoding. This matches what the Delphi/TNetHTTPClient path already does. Surfaced via the container2wasm in-browser build, but affects native FPC + Gemini too. Verified: clean rebuild (default and C2W=1), no new warnings.
The agent command only treats -m/--message as the prompt; a bare
positional ('pasclaw agent "hello"') is ignored and just starts an
interactive session. Correct the post-onboarding 'Next:' hint so the
one-shot example actually sends the message.
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.
Gemini POSTs fail with HTTP 415 on FPC builds
The FPC/Indy request path set:
Content-Encodingis only for transfer codings (gzip/deflate/br/identity) —utf-8is not one. Anthropic and OpenAI ignore the bogus header, but Gemini strictly rejects the unknown content-coding with415 Unsupported Media Type, sogemini/*chat POSTs (generateContent) fail:(The model-list
GEThas no body/Content-Type, which is why discovery worked but chat didn't.) The Delphi/TNetHTTPClientpath already does this correctly (application/json; charset=utf-8, noContent-Encoding); only the FPC path was wrong.Fix
All four Indy request sites (
PostJSON,PutJSON,PostRaw,PostJSONToStream) now put the charset inContent-Typeand dropContent-Encoding:application/json; charset=utf-8ContentType + '; charset=utf-8'forPostRawNotes
Verified
Clean rebuild under FPC 3.2.2, both default and
C2W=1, no new warnings.https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6
Generated by Claude Code