1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

add accesslog+proxy example

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-19 17:47:44 +03:00
parent fc2aada3c7
commit a04a6b5011
9 changed files with 199 additions and 28 deletions

View File

@@ -6,6 +6,7 @@ import (
stdContext "context"
"fmt"
"io"
"net/http"
"net/http/httputil"
"os"
"strconv"
@@ -788,7 +789,9 @@ func (ac *AccessLog) after(ctx *context.Context, lat time.Duration, method, path
bytesReceived = requestBodyLength // store it, if the total is enabled then this will be overridden.
}
if err != nil && ac.RequestBody {
requestBody = ac.getErrorText(err)
if err != http.ErrBodyReadAfterClose { // if body was already closed, don't send it as error.
requestBody = ac.getErrorText(err)
}
} else if requestBodyLength > 0 {
if ac.RequestBody {
if ac.BodyMinify {