mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
fix(proxy): keep package names that start with the registry name
The app mounts each handler behind http.StripPrefix. The npm and PyPI handlers trimmed the registry prefix a second time. A request for npm-run-all reached upstream as -run-all, and the npm package itself became an empty path. PyPI trimmed /simple without a segment check.
This commit is contained in:
@@ -58,7 +58,7 @@ func New(cacheManager *cache.Manager, client *network.Client, config Config) *Ha
|
||||
// ServeHTTP handles NPM registry requests
|
||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
path := strings.TrimPrefix(r.URL.Path, "/npm")
|
||||
path := r.URL.Path
|
||||
|
||||
log.Debug().Str("path", path).Str("method", r.Method).Msg("NPM proxy request")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user