"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/server/service/proxy.go" between
traefik-v2.3.2.src.tar.gz and traefik-v2.3.3.src.tar.gz

About: Traefik is a cloud native edge router, a reverse proxy and load balancer for HTTP and TCP-based applications.

proxy.go  (traefik-v2.3.2.src):proxy.go  (traefik-v2.3.3.src)
package service package service
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"io" "io"
"net" "net"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
"net/url" "net/url"
"time" "time"
ptypes "github.com/traefik/paerser/types" ptypes "github.com/traefik/paerser/types"
"github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/traefik/traefik/v2/pkg/config/dynamic"
skipping to change at line 86 skipping to change at line 87
delete(outReq.Header, "Sec-Websocket-Protocol") delete(outReq.Header, "Sec-Websocket-Protocol")
delete(outReq.Header, "Sec-Websocket-Version") delete(outReq.Header, "Sec-Websocket-Version")
}, },
Transport: defaultRoundTripper, Transport: defaultRoundTripper,
FlushInterval: time.Duration(flushInterval), FlushInterval: time.Duration(flushInterval),
BufferPool: bufferPool, BufferPool: bufferPool,
ErrorHandler: func(w http.ResponseWriter, request *http.Request, err error) { ErrorHandler: func(w http.ResponseWriter, request *http.Request, err error) {
statusCode := http.StatusInternalServerError statusCode := http.StatusInternalServerError
switch { switch {
case err == io.EOF: case errors.Is(err, io.EOF):
statusCode = http.StatusBadGateway statusCode = http.StatusBadGateway
case err == context.Canceled: case errors.Is(err, context.Canceled):
statusCode = StatusClientClosedRequest statusCode = StatusClientClosedRequest
default: default:
if e, ok := err.(net.Error); ok { var netErr net.Error
if e.Timeout() { if errors.As(err, &netErr) {
if netErr.Timeout() {
statusCode = http.StatusGatewayTi meout statusCode = http.StatusGatewayTi meout
} else { } else {
statusCode = http.StatusBadGatewa y statusCode = http.StatusBadGatewa y
} }
} }
} }
log.Debugf("'%d %s' caused by: %v", statusCode, statusTex t(statusCode), err) log.Debugf("'%d %s' caused by: %v", statusCode, statusTex t(statusCode), err)
w.WriteHeader(statusCode) w.WriteHeader(statusCode)
_, werr := w.Write([]byte(statusText(statusCode))) _, werr := w.Write([]byte(statusText(statusCode)))
 End of changes. 4 change blocks. 
4 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)