This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 40 · Sep 29 – Oct 5, 2025

Deprecate ReverseProxy.Director in favor of ReverseProxy.Rewrite

Worth knowingstdlib

What changed
net/http/httputil.ReverseProxy.Director is now deprecated; ReverseProxy.Rewrite should be used instead. NewSingleHostReverseProxy will continue to use Director for compatibility.
Production impact
The source does not say.
Try it
Create a httputil.ReverseProxy and set its Rewrite field, then observe the deprecation warning in the compiler output.
Source
github.com/golang/go/issues/73161

Understand it, then run it

net/http/httputil.ReverseProxy had a field called Director. That field let you change the request before it was sent to the target server. It was found to be insecure, so the Go team decided to mark it as deprecated. The replacement is a field called Rewrite. The old helper NewSingleHostReverseProxy still uses Director for backward compatibility, but new code should use Rewrite instead.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed