transparency-dev / transparency-dev/tesseract
`isValidOrigin` cannot handle origin string with a port number
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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