Loading
Set charset on Orbit grep llm response
What does this MR do and why?
The llm response of the Orbit grep endpoint came back as text/plain with no charset, while the other Orbit plain-text responses declare UTF-8. Grep accepts multi-byte search terms, so a client that defaults to another charset could garble the output. This sets charset=utf-8 and asserts the header in the request spec.
Related Issues
Follow-up to !256404 (merged), raised by GitLab Duo on the 19.4 backport (!264303 (merged)).
Testing
On master the new spec assertion fails: expected: "text/plain; charset=utf-8", got: "text/plain". With the change, ee/spec/requests/api/orbit/data_grep_spec.rb passes (60 examples, 0 failures, 2 pending).
Performance Analysis
- This merge request does not introduce any performance regression.
Agent context
present_orbit_grepinee/lib/api/orbit/data.rbnow passestext/plain; charset=utf-8tocontent_type, matchingpresent_orbit_contextand the skill file endpoint.- Confirmed Grape/Rack adds no charset on its own: the unmodified endpoint returned
Content-Type: text/plain. - The existing llm-format example now also checks
response.headers['Content-Type'];media_typestrips parameters so it could not catch this. - Rubocop clean on both files. Backporting is left to the Orbit backport hub.