Skip to content

fix(docs): stop sending the docs API cookie - #829

Merged
JoshMock merged 1 commit into
elastic:mainfrom
akira28:fix/docs-drop-cookie
Nov 18, 2026
Merged

JoshMock merged 1 commit into
elastic:mainfrom
akira28:fix/docs-drop-cookie

Conversation

@akira28

@akira28 akira28 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

elastic docs search and elastic docs ask stop sending the feature_search_or_askai_enabled=true cookie.

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: drops DOCS_COOKIE and the Cookie header 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

npm test   # 2422 pass
curl -s -o /dev/null -w '%{http_code}\n' "https://www.elastic.co/docs/_api/v1/search?q=health%20$RANDOM&size=1"   # 200, no cookie

🤖 Generated with Claude Code

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]>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 11:45
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]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_COOKIE and the Cookie header 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

@JoshMock JoshMock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JoshMock
JoshMock merged commit b7db015 into elastic:main Nov 18, 2026
37 checks passed
@akira28
akira28 deleted the fix/docs-drop-cookie branch November 18, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants