Skip to content

Behaviour of api for crate names #283

Closed
@caulagi

Description

@caulagi

Is the treatment of crate names (particularly underscores and hyphens) something that can be relied on?

$ curl -I -H "Content-Type: application/json" -H "Accept: application/json" https://crates.io/api/v1/crates/error-def
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx
$
$ curl -I -H "Content-Type: application/json" -H "Accept: application/json" https://crates.io/api/v1/crates/error_def
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx
$
$ curl -I -H "Content-Type: application/json" -H "Accept: application/json" https://crates.io/api/v1/crates/errror_def
HTTP/1.1 404 Not Found
Connection: keep-alive
Server: nginx

So in this case, error_def is the correct crate name, but asking for error-def also gives a 200. Is this documented or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions