Skip to content

[BUG] OAuth callback page: broken Cyrillic on Windows (missing charset=utf-8) #217

Closed

Description

@mabiuroot-art

Description

After a successful OAuth authentication for MCP (streamable-http), the browser displays the callback page at http://127.0.0.1:<port>/callback with Cyrillic characters rendered as mojibake (УÑпешно! instead of "Успешно!").

However, the authentication itself is successful — the issue affects only the HTML rendering.

Environment

  • OS: Windows 10/11
  • VS Code + Zoo Code extension (ZooCodeOrganization.zoo-code, v3.54.1)
  • MCP: remote streamable-http + Keycloak OAuth
  • UI Locale: Russian (ru)

Root Cause

In src/services/mcp/utils/callbackServer.ts, the response is returned as:

"Content-Type": "text/html"

... without charset=utf-8, and the <head> section lacks <meta charset="utf-8">.
Strings from t("mcp:oauth.callback.auth_success"), etc., are in UTF-8, but browsers on Windows often interpret them as Windows-1251.

Proposed Fix

  1. In all res.writeHead(..., { "Content-Type": ... }) calls for HTML, update the header to:
    "Content-Type": "text/html; charset=utf-8"
  2. Add the following tag to the <head> of every HTML template:
    <meta charset="utf-8">

Affected Files

  • src/services/mcp/utils/callbackServer.ts (approx. lines 94–180)
  • src/i18n/locales/ru/mcp.json → oauth.callback.*

Expected Behavior

The text should render correctly without corruption: "Успешно! MCP-сервер успешно аутентифицирован…".

Activity

  1. changed the title [-][BUG][/-] [+][BUG] OAuth callback page: broken Cyrillic on Windows (missing charset=utf-8)[/+] on May 20, 2026
  2. mabiuroot-art commented on May 25, 2026

    @mabiuroot-art
    Author

    Thx! Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions