Skip to content

proposal: net/http: add Unregister method to ServeMux #50056

Closed
@rgooch

Description

@rgooch

Currently it is not possible to dynamically register and deregister path handlers with a ServeMux object. Once a handler for a path is registered, it cannot be changed or removed.
Solutions to work around this (such as wrapping ServeMux) can lead to a growing map containing stale handlers.

The proposal is to add an Unregister method with the following function signature:
func (mux *ServeMux) Unregister(pattern string)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions