summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2021-01-11 13:35:12 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2021-01-19 18:43:01 -0700
commit1ac6351705e06316d261d2d1cc926ce33d6f23b4 (patch)
treea97022ca5e78258f6b79f88b6f447c36c3cf7b76 /modules/caddyhttp
parent160d19999982c4facd32c4bddced5a7dc91e8a40 (diff)
Revert "requestbody: Allow overwriting remote address"
This reverts commit 0bf2046da7f2f5bf1b7d9fa055ae28de9a06ddaf. No actual use case.
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/requestbody/requestbody.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/modules/caddyhttp/requestbody/requestbody.go b/modules/caddyhttp/requestbody/requestbody.go
index 35aa1af..76cd274 100644
--- a/modules/caddyhttp/requestbody/requestbody.go
+++ b/modules/caddyhttp/requestbody/requestbody.go
@@ -29,11 +29,6 @@ func init() {
type RequestBody struct {
// The maximum number of bytes to allow reading from the body by a later handler.
MaxSize int64 `json:"max_size,omitempty"`
-
- // Overwrites the remote address from which the request came. This is destructive;
- // handlers later in the chain will not be able to recover the true originating
- // address of the request. EXPERIMENTAL: May get changed or removed later.
- RemoteAddress string `json:"remote_address,omitempty"`
}
// CaddyModule returns the Caddy module information.
@@ -45,10 +40,6 @@ func (RequestBody) CaddyModule() caddy.ModuleInfo {
}
func (rb RequestBody) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
- if rb.RemoteAddress != "" {
- repl := r.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
- r.RemoteAddr = repl.ReplaceAll(rb.RemoteAddress, "")
- }
if r.Body == nil {
return next.ServeHTTP(w, r)
}