Repository navigation
fix(docs): stop sending the docs API cookie - #829
Merged
Merged
Conversation
elastic.co's CDN no longer gates the docs API behind feature_search_or_askai_enabled (elastic/docs-infra#523), so elastic docs search and elastic docs ask send no cookie. Co-Authored-By: Claude Opus 5.5 <[email protected]>
akira28
added a commit
to akira28/cli
that referenced
this pull request
Nov 18, 2026
elastic/docs-infra#523 removed the CDN's cookie gate. elastic#829 drops it from search and ask on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were reported for the change removing the obsolete cookie from docs API requests.
No open issues 🎉
What changed in this PR
Removes the obsolete cookie from the Elastic CLI docs API requests following removal of the production CDN cookie gate.
Changes:
- Removes
DOCS_COOKIEand theCookieheader from search and Ask AI requests. - Adds regression tests for both requests’ exact headers and the Ask AI URL, method, and body.
| File | Description |
|---|---|
test/docs/client.test.ts |
Adds assertions that requests omit cookies and preserve expected request details. |
src/docs/client.ts |
Removes the cookie constant and header from both docs API requests. |
Review effort: Balanced
Draft
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.
elastic docs searchandelastic docs askstop sending thefeature_search_or_askai_enabled=truecookie.Why
elastic/docs-infra#523 removed the production CDN's cookie gate on the docs API (
/docs/_api/v1), and it is applied. The cookie now does nothing.What
src/docs/client.ts: dropsDOCS_COOKIEand theCookieheader from the search and Ask AI requests.test/docs/client.test.ts: asserts the full headers of both requests (and the Ask AI method, URL and body), so the cookie can't come back unnoticed.Verify
🤖 Generated with Claude Code