"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/middlewares/auth/forward.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.

forward.go  (traefik-v2.3.2.src):forward.go  (traefik-v2.3.3.src)
package auth package auth
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"net" "net"
"net/http" "net/http"
"strings" "strings"
"time" "time"
"github.com/opentracing/opentracing-go/ext" "github.com/opentracing/opentracing-go/ext"
"github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/traefik/traefik/v2/pkg/config/dynamic"
"github.com/traefik/traefik/v2/pkg/log" "github.com/traefik/traefik/v2/pkg/log"
skipping to change at line 127 skipping to change at line 128
if forwardResponse.StatusCode < http.StatusOK || forwardResponse.StatusCo de >= http.StatusMultipleChoices { if forwardResponse.StatusCode < http.StatusOK || forwardResponse.StatusCo de >= http.StatusMultipleChoices {
logger.Debugf("Remote error %s. StatusCode: %d", fa.address, forw ardResponse.StatusCode) logger.Debugf("Remote error %s. StatusCode: %d", fa.address, forw ardResponse.StatusCode)
utils.CopyHeaders(rw.Header(), forwardResponse.Header) utils.CopyHeaders(rw.Header(), forwardResponse.Header)
utils.RemoveHeaders(rw.Header(), forward.HopHeaders...) utils.RemoveHeaders(rw.Header(), forward.HopHeaders...)
// Grab the location header, if any. // Grab the location header, if any.
redirectURL, err := forwardResponse.Location() redirectURL, err := forwardResponse.Location()
if err != nil { if err != nil {
if err != http.ErrNoLocation { if !errors.Is(err, http.ErrNoLocation) {
logMessage := fmt.Sprintf("Error reading response location header %s. Cause: %s", fa.address, err) logMessage := fmt.Sprintf("Error reading response location header %s. Cause: %s", fa.address, err)
logger.Debug(logMessage) logger.Debug(logMessage)
tracing.SetErrorWithEvent(req, logMessage) tracing.SetErrorWithEvent(req, logMessage)
rw.WriteHeader(http.StatusInternalServerError) rw.WriteHeader(http.StatusInternalServerError)
return return
} }
} else if redirectURL.String() != "" { } else if redirectURL.String() != "" {
// Set the location in our response if one was sent back. // Set the location in our response if one was sent back.
rw.Header().Set("Location", redirectURL.String()) rw.Header().Set("Location", redirectURL.String())
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

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