Skip to content

Commit

Permalink
incusd/request: Strip port from event address
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Aug 5, 2024
1 parent 6326d9b commit 58a0f1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/server/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func CreateRequestor(r *http.Request) *api.EventLifecycleRequestor {
requestor.Address = val
}

// Strip port from address.
host, _, err := net.SplitHostPort(requestor.Address)
if err == nil {
requestor.Address = host
}

return requestor
}

Expand Down

0 comments on commit 58a0f1a

Please sign in to comment.