Skip to content

isValidOrigin cannot handle origin string with a port number #679

@cmurphy

Description

@cmurphy

Description

An origin string like '127.0.0.1:8000' should be a valid submission prefix according to the specification. However, isValidOrigin returns an error, because it cannot parse it as a schema-less URL:

Can't initialize CT HTTP Server: newLog(): origin "127.0.0.1:8000" is not valid: can't parse origin as an URL: parse "127.0.0.1:8000": first path segment in URL cannot contain colon

Adding a schema prefix of course results in an error as well.

I think using url.Parse is not the best option for this validation check because it cannot recognize a URL that includes a non-standard port if the URL does not have a scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions