Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to unwrap ResponseWriter set by Middleware #35

Commits on Dec 21, 2018

  1. Add ability to unwrap ResponseWriter set by Middleware

    When wrapping an HTTP server with Middleware(), HTTP handlers lose the
    ability to cast their ResponseWriter argument to any of the optional
    interfaces like http.Flusher or http.Hijacker. This commit adds an
    optional interface ResponseWriterWrapper which has a method for
    unwrapping the ResponseWriter installed by Middleware.
    
    Existing handlers can then test for implementation of this interface and
    do an unwrap if the conversion succeeds, and then use whatever
    underlying optional http interfaces were previously accessible.
    
    Addresses opentracing-contrib#34
    mpuncel committed Dec 21, 2018
    Configuration menu
    Copy the full SHA
    ee969ee View commit details
    Browse the repository at this point in the history