Skip to content

FRA-2021: Escape non-ascii characters#619

Merged
alanjcharles14 merged 4 commits into
masterfrom
alancharles/fra-2021-bug-special-character-in-app-name-causes-error_server-and
Jun 10, 2026
Merged

FRA-2021: Escape non-ascii characters#619
alanjcharles14 merged 4 commits into
masterfrom
alancharles/fra-2021-bug-special-character-in-app-name-causes-error_server-and

Conversation

@alanjcharles14

Copy link
Copy Markdown
Contributor

Escapes any non-ASCII character in the header value to a JSON \uXXXX sequence so the value is always ASCII-safe, while remaining valid JSON that the backend decodes identically.

#expect(decoded?["name"] == "Café")
}

@Test func escapeNonAsciiHandlesEmojiSurrogatePairs() throws {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

probably not strictly necessary, but fun

@alanjcharles14 alanjcharles14 requested a review from lmeier June 9, 2026 22:42
@lmeier

lmeier commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@alanjcharles14 did we test against the server with an escaped name? Just to confirm e2e behavior? Otherwise lgtm

@alanjcharles14

Copy link
Copy Markdown
Contributor Author

@lmeier seems unnecessary since the server is just parsing the json which is functionally equivalent to what the tests here are doing.

    let applicationInfo;
    try {
      applicationInfo = headers['x-radar-app-info'] ? JSON.parse(headers['x-radar-app-info']) : undefined;
    } catch {
      applicationInfo = undefined;
    }

running this in a terminal shows that it was handled correctly on the server already and handles the new fix though:
image

@alanjcharles14 alanjcharles14 merged commit d85c143 into master Jun 10, 2026
2 checks passed
@alanjcharles14 alanjcharles14 deleted the alancharles/fra-2021-bug-special-character-in-app-name-causes-error_server-and branch June 10, 2026 22:48
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