Repository navigation
util/git: add domain suffix host matching and fix trailing slash handling - #407
Conversation
Signed-off-by: Xueqin Cui <cuixq@google.com>
|
Hi @cuixq, Trailing slash support is already in the host handler. Did you consider adding a host handler for |
|
@calebbrown Adding a host handler for Also, since Do you prefer keeping this in |
|
So my prior take on this in https://github.com/ossf/malicious-packages/blob/main/internal/gitname/hosts.go had support for domain suffix mapping. This is definitely worth adding. I didn't add it here originally since it made the code more complex. I think the right thing to do is:
|
…ling Signed-off-by: Xueqin Cui <cuixq@google.com>
canon
RegisterHostHandlerandgetHostHandlerwhen the registered host starts with., and register aStandardHostHandlerfor.googlesource.com.res.Pathat the start ofStandardHostHandler.Canon()before segment counting and.gitsuffix checks, and re-add the slash at the end only whenHasTrailingSlashistrue.