mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-15 11:19:08 +02:00
This reverts commit a8817cab0.
The pattern was meant to mirror DebugUpload.Validate, and it does not. Go's
url.Parse lowercases the scheme and accepts a bracketed IPv6 literal, so all
three validators take `HTTPS://example.com` and `https://[2001:db8::1]/bundle`
while the regex rejects both; in the other direction the regex accepts control
characters in the path that url.Parse refuses. Measured, 3 of 4 sample values
disagreed.
A schema that rejects what the API accepts is worse than one that says nothing,
and chasing url.Parse with a regex just creates a second rule to keep in sync.
The prose description already states the requirement, and the handler stays the
thing that enforces it.
Reported by cubic on #7514, which offered dropping the pattern as the
alternative to fixing it.
490 KiB
490 KiB