Releases: urfave/negroni
Releases · urfave/negroni
v3.1.1
v3.1.0
v3.0.0
Fixed
- Replace multiple slashes at the beginning of a path with a single one to avoid
open redirects - Avoid updating
ResponseWriter.Status()if the status has already been
written whenResponseWriter.WriteHeader()is called twice
Changed
ResponseWriternow only implementshttpinterfaces (Flusher,Hijacker,
CloseNotifier) if the wrappedhttp.ResponseWriterdoes. This is a breaking
change to makeResponseWriter's interface support more accurate
Added
ResponseWriternow implementsio.ReaderFromto more efficiently send
responses viaio.Copy
v2.0.2
v2.0.1
v2.0.0
Changed
Recovery.PrintStack, when false, now also supresses the panic message in
addition to supressing the stack trace
Fixed
Negroni.With()now copies handlers to avoid mutating the originalNegroni
instance ifUseis called on the newNegroniinstance
Added
Recovery.LogStackwas added to control whether the stacktrace is logged for
panics
v1.0.0
v0.3.0
Added
With()helper for building a newNegronistruct chaining handlers from
existingNegronistructs- Format log output in
Loggermiddleware via a configurabletext/template
string injectable via.SetFormat. AddedLoggerDefaultFormatand
LoggerDefaultDateFormatto configure the default template and date format
used by theLoggermiddleware. - Support for HTTP/2 pusher support via
http.Pusherinterface for Go 1.8+. WrapFuncto converthttp.HandlerFuncinto anegroni.HandlerFormatterfield added toRecoverymiddleware to allow configuring how
panics are output. Default ofTextFormatter(how it was output in
0.2.0) used.HTMLPanicFormatteralso added to allow easy outputing of
panics as HTML.
Fixed
Written()correct returnsfalseif no response header has been written- Only implement
http.CloseNotifierwith thenegroni.ResponseWriterif the
underlyinghttp.ResponseWriterimplements it (previously would always
implement it and panic if the underlyinghttp.ResponseWriterdid not.
Changed
- Set default status to
0in the case that no handler writes status -- was
previously200(in 0.2.0, before that it was0so this reestablishes that
behavior) - Catch
panics thrown by callbacks provided to theRecoveryhandler - Recovery middleware will set
text/plaincontent-type if none is set ALoggerinterface to allow custom logger outputs to be used with the
Loggermiddleware. Changes embeded field innegroni.LoggerfromLogger
toALogger.- Default
Loggermiddleware output changed to be more structure and verbose
(also now configurable, seeAdded) - Automatically bind to port specified in
$PORTin.Run()if an address is
not passed in. Fall back to binding to:8080if no address specified
(configuable viaDefaultAddress). PanicHandlerFuncadded toRecoverymiddleware to enhance custom handling
ofpanics by providing additional information to the handler including the
stack and thehttp.Request.Recovery.ErrorHandlerFuncwas also added, but
deprecated in favor of the newPanicHandlerFunc.
v0.2.0
Added
- Support for variadic handlers in
New() - Added
Negroni.Handlers()to fetch all of the handlers for a given chain - Allowed size in
Recoveryhandler was bumped to 8k Negroni.UseFuncto push another handler onto the chain
Changed
- Set the status before calling
beforeFuncsso the information is available to them - Set default status to
200in the case that no handler writes status -- was previously0 - Panic if
nilhandler is given tonegroni.Use
v0.1.0
Merge pull request #16 from unrolled/master Secure package was renamed.