mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
add context#StatusCodeNotSuccessful for customize even the most customized clients that are not compatible with the standards and fix the SPA if static file serve handlers are passed as its AssetHandler as reported at the chat.iris-go.com
Former-commit-id: ccd0815a09b9305bfbeaad7b46559dd86f34f20b
This commit is contained in:
@@ -254,7 +254,7 @@ func (w *fsHandler) Build() context.Handler {
|
||||
gzipEnabled)
|
||||
|
||||
// check for any http errors after the file handler executed
|
||||
if prevStatusCode >= 400 { // error found (404 or 400 or 500 usually)
|
||||
if context.StatusCodeNotSuccessful(prevStatusCode) { // error found (404 or 400 or 500 usually)
|
||||
if writer, ok := ctx.ResponseWriter().(*context.GzipResponseWriter); ok && writer != nil {
|
||||
writer.ResetBody()
|
||||
writer.Disable()
|
||||
|
||||
Reference in New Issue
Block a user