Skip to content

Commit

Permalink
pub: fix args slice starting index
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed Jan 24, 2024
1 parent d72768e commit 6e15755
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/pub/pub.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func registerRules(mux *http.ServeMux, args []string) {
if len(args)%2 != 0 {
slog.Warn("uneven number of args passed as rules, dropping the last")
}
pairs := partitionIntoPairs(args[1:])
pairs := partitionIntoPairs(args)
for _, pair := range pairs {
slog.Info(fmt.Sprintf("publishing: %s -> %s", pair[0], pair[1]))
mux.Handle(pair[0], http.StripPrefix(strings.TrimSuffix(pair[0], "/"), handler.Handler(pair[1])))
Expand Down

0 comments on commit 6e15755

Please sign in to comment.