Skip to content

Decode HTML entities in cURL input before parsing#7

Open
Copilot wants to merge 2 commits intomainfrom
copilot/add-curl-command-example
Open

Decode HTML entities in cURL input before parsing#7
Copilot wants to merge 2 commits intomainfrom
copilot/add-curl-command-example

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

When cURL commands are copied from browser DevTools, URLs may contain HTML-encoded entities (e.g., &amp; instead of &). This causes malformed requests that return HTML error pages, which then fail at JSON parsing with invalid character '<' looking for beginning of value.

  • Apply html.UnescapeString() to the raw cURL input in both getKBList() and getKBListSafe() before regex parsing
  • Add test using httptest.Server to verify &amp; in query strings is decoded before the request is made

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Muleizhang <65743337+Muleizhang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add example of complete cURL command Decode HTML entities in cURL input before parsing Mar 9, 2026
@Muleizhang Muleizhang marked this pull request as ready for review March 9, 2026 06:50
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.

2 participants