summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
diff options
context:
space:
mode:
authorJacob Gadikian <jacobgadikian@gmail.com>2023-08-08 03:40:31 +0800
committerGitHub <noreply@github.com>2023-08-07 19:40:31 +0000
commitb32f265ecad60404c3818cc9d42e367a8e4eb7d4 (patch)
tree16d79c3ad7ddf0cc6f7915d1e47bdd6d269bf8d5 /modules/caddyhttp/reverseproxy
parent431adc09805972196314b2b188904942cbe5dfee (diff)
ci: Use gofumpt to format code (#5707)
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r--modules/caddyhttp/reverseproxy/addresses.go3
-rw-r--r--modules/caddyhttp/reverseproxy/caddyfile.go1
-rw-r--r--modules/caddyhttp/reverseproxy/command.go3
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/client.go3
-rw-r--r--modules/caddyhttp/reverseproxy/reverseproxy.go3
-rw-r--r--modules/caddyhttp/reverseproxy/streaming.go6
6 files changed, 11 insertions, 8 deletions
diff --git a/modules/caddyhttp/reverseproxy/addresses.go b/modules/caddyhttp/reverseproxy/addresses.go
index 0939497..82c1c79 100644
--- a/modules/caddyhttp/reverseproxy/addresses.go
+++ b/modules/caddyhttp/reverseproxy/addresses.go
@@ -45,12 +45,15 @@ func (p parsedAddr) dialAddr() string {
}
return net.JoinHostPort(p.host, p.port)
}
+
func (p parsedAddr) rangedPort() bool {
return strings.Contains(p.port, "-")
}
+
func (p parsedAddr) replaceablePort() bool {
return strings.Contains(p.port, "{") && strings.Contains(p.port, "}")
}
+
func (p parsedAddr) isUnix() bool {
return caddy.IsUnixNetwork(p.network)
}
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go
index f5eb7a5..774f889 100644
--- a/modules/caddyhttp/reverseproxy/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/caddyfile.go
@@ -549,7 +549,6 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
h.RequestBuffers = int64(size)
} else if subdir == "response_buffers" {
h.ResponseBuffers = int64(size)
-
}
// TODO: These three properties are deprecated; remove them sometime after v2.6.4
diff --git a/modules/caddyhttp/reverseproxy/command.go b/modules/caddyhttp/reverseproxy/command.go
index 8438b72..9359f3d 100644
--- a/modules/caddyhttp/reverseproxy/command.go
+++ b/modules/caddyhttp/reverseproxy/command.go
@@ -284,7 +284,8 @@ func cmdReverseProxy(fs caddycmd.Flags) (int, error) {
var false bool
cfg := &caddy.Config{
- Admin: &caddy.AdminConfig{Disabled: true,
+ Admin: &caddy.AdminConfig{
+ Disabled: true,
Config: &caddy.ConfigSettings{
Persist: &false,
},
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/client.go b/modules/caddyhttp/reverseproxy/fastcgi/client.go
index ae36dd8..04513dd 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/client.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/client.go
@@ -251,7 +251,6 @@ func (c *client) Request(p map[string]string, req io.Reader) (resp *http.Respons
// Get issues a GET request to the fcgi responder.
func (c *client) Get(p map[string]string, body io.Reader, l int64) (resp *http.Response, err error) {
-
p["REQUEST_METHOD"] = "GET"
p["CONTENT_LENGTH"] = strconv.FormatInt(l, 10)
@@ -260,7 +259,6 @@ func (c *client) Get(p map[string]string, body io.Reader, l int64) (resp *http.R
// Head issues a HEAD request to the fcgi responder.
func (c *client) Head(p map[string]string) (resp *http.Response, err error) {
-
p["REQUEST_METHOD"] = "HEAD"
p["CONTENT_LENGTH"] = "0"
@@ -269,7 +267,6 @@ func (c *client) Head(p map[string]string) (resp *http.Response, err error) {
// Options issues an OPTIONS request to the fcgi responder.
func (c *client) Options(p map[string]string) (resp *http.Response, err error) {
-
p["REQUEST_METHOD"] = "OPTIONS"
p["CONTENT_LENGTH"] = "0"
diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go
index 842d75d..b65dce7 100644
--- a/modules/caddyhttp/reverseproxy/reverseproxy.go
+++ b/modules/caddyhttp/reverseproxy/reverseproxy.go
@@ -450,7 +450,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht
// It returns true when the loop is done and should break; false otherwise. The error value returned should
// be assigned to the proxyErr value for the next iteration of the loop (or the error handled after break).
func (h *Handler) proxyLoopIteration(r *http.Request, origReq *http.Request, w http.ResponseWriter, proxyErr error, start time.Time, retries int,
- repl *caddy.Replacer, reqHeader http.Header, reqHost string, next caddyhttp.Handler) (bool, error) {
+ repl *caddy.Replacer, reqHeader http.Header, reqHost string, next caddyhttp.Handler,
+) (bool, error) {
// get the updated list of upstreams
upstreams := h.Upstreams
if h.DynamicUpstreams != nil {
diff --git a/modules/caddyhttp/reverseproxy/streaming.go b/modules/caddyhttp/reverseproxy/streaming.go
index 71b9386..c5369d8 100644
--- a/modules/caddyhttp/reverseproxy/streaming.go
+++ b/modules/caddyhttp/reverseproxy/streaming.go
@@ -522,5 +522,7 @@ var streamingBufPool = sync.Pool{
},
}
-const defaultBufferSize = 32 * 1024
-const wordSize = int(unsafe.Sizeof(uintptr(0)))
+const (
+ defaultBufferSize = 32 * 1024
+ wordSize = int(unsafe.Sizeof(uintptr(0)))
+)