Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Aug 19, 2023
1 parent 128cc0f commit d88fa5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/http/libp2phttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,15 @@ func (h *HTTPHost) Close() error {
// SetHTTPHandler sets the HTTP handler for a given protocol. Automatically
// manages the .well-known/libp2p mapping.
// http.StripPrefix is called on the handler, so the handler will be unaware of
// it's prefix path.
// its prefix path.
func (h *HTTPHost) SetHTTPHandler(p protocol.ID, handler http.Handler) {
h.SetHTTPHandlerAtPath(p, string(p), handler)
}

// SetHTTPHandlerAtPath sets the HTTP handler for a given protocol using the
// given path. Automatically manages the .well-known/libp2p mapping.
// http.StripPrefix is called on the handler, so the handler will be unaware of
// it's prefix path.
// its prefix path.
func (h *HTTPHost) SetHTTPHandlerAtPath(p protocol.ID, path string, handler http.Handler) {
if path == "" || path[len(path)-1] != '/' {
// We are nesting this handler under this path, so it should end with a slash.
Expand Down

0 comments on commit d88fa5e

Please sign in to comment.