transparency-dev / transparency-dev/tesseract

`isValidOrigin` cannot handle origin string with a port number

Open
#679 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
37
Forks
18
Avg merge
19h 22m
Merged PRs (30d)
15

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate isValidOrigin and inspect its current url.Parse-based validation, then compare it with the linked Static CT API specification. Update the validation so an origin such as 127.0.0.1:8000 is accepted without a scheme while invalid origins remain rejected, and run the relevant existing tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.