Steps to reproduce:
1. Install apt-cacher-ng in its default configuration
2. Make sure d-i.debian.org is not present in wget's HSTS database by running 'rm -f "$HOME/.wget-hsts"'
3. Run "http_proxy=http://localhost:3142/ wget http://d-i.debian.org/". You will see:
%%% begin %%%
root@26890f84728d:/# http_proxy=http://localhost:3142/ wget http://d-i.debian.org/
--2022-11-03 09:01:47-- http://d-i.debian.org/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:3142... connected.
Proxy request sent, awaiting response... 400 Bad Request
2022-11-03 09:01:47 ERROR 400: Bad Request.
%%% end %%%
Here is full steps to reproduce: https://builds.sr.ht/~safinaskar/job/874839 . Click "view manifest »" to view (commented) script.