Skip to content

Group name is case-sensitive on Linux #1699

@kantord

Description

@kantord

Bug description

Group names are designed to be case-insensitive, but they are case-sensitive on Linux.

Steps to reproduce

On any Linux distribution, make the following request:

curl 'http://localhost:46381/api/v1beta/groups' \
  -H 'Accept: */*' \
  -H 'Accept-Language: en-US' \
  -H 'Connection: keep-alive' \
  -H 'Referer: http://localhost:5173/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-site' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) ToolHive/0.0.0-dev Chrome/138.0.7204.185 Electron/37.2.6 Safari/537.36' \
  -H 'content-type: application/json' \
  -H 'sec-ch-ua: "Not)A;Brand";v="8", "Chromium";v="138"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'x-client-platform: linux' \
  -H 'x-client-release-build: false' \
  -H 'x-client-type: toolhive-studio' \
  -H 'x-client-version: 0.0.0-dev' \
  --data-raw '{"name":"defAult"}'

this should fail, because the default group always exists. But on Linux, I am able to create a group called defAult

Expected behavior

Error:

"group_already_exists: group 'defAult' already exists"

Actual behavior

on Linux, I am able to create a group called defAult

Environment (if relevant)

ToolHive v0.2.15
Commit: d274a0a
Built: 2025-09-02 15:05:24 UTC
Go version: go1.24.1
Platform: linux/amd64

Additional context

Seems like the problem is this:

On Linux/amd64 (so, standard Linux on x86-64), the behavior of os.Stat(filePath) is case-sensitive almost all the time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggoPull requests that update go codegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions