Skip to content

fix: correct Windows OS detection typo in getNormalizedOS#289

Open
MaxwellCalkin wants to merge 1 commit intoanthropics:mainfrom
MaxwellCalkin:fix/windows-os-detection
Open

fix: correct Windows OS detection typo in getNormalizedOS#289
MaxwellCalkin wants to merge 1 commit intoanthropics:mainfrom
MaxwellCalkin:fix/windows-os-detection

Conversation

@MaxwellCalkin
Copy link
Copy Markdown

Summary

  • getNormalizedOS() in internal/requestconfig/requestconfig.go compares against "window" instead of "windows", causing Windows users to always hit the default case and report "Other:windows" in the X-Stainless-OS header instead of "Windows"
  • runtime.GOOS returns "windows" (with trailing 's') on Windows — see Go documentation
  • One-character fix: "window" -> "windows"

Test plan

  • Verify runtime.GOOS documentation confirms the value is "windows" not "window"
  • Run existing tests to confirm no regressions
  • Verify on a Windows machine that X-Stainless-OS header now reports "Windows" instead of "Other:windows"

🤖 Generated with Claude Code

`runtime.GOOS` returns "windows" on Windows, but `getNormalizedOS()`
checks for "window" (missing trailing 's'). This causes the function to
fall through to the default case, reporting "Other:windows" instead of
"Windows" in the X-Stainless-OS header for all Windows users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxwellCalkin MaxwellCalkin requested a review from a team as a code owner March 8, 2026 21:43
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.

1 participant