warehouse
warehouse copied to clipboard
Disallow trailing new line in `PROJECT_NAME_RE`
I noticed this while working on #16260: the regex used to validate project names in some context permits trailing newlines in the project name. This is because in Python regexes $ matches the end of the string or a trailing newline. \Z is how you match the end of the string.
I do not think that this has any security implications because, though the equivalent Postgres constraint uses $, in Postgres $ matches only the end of the string. The constraint has been present since time immemorial.