Remove "Server:" header

sebsauvage at gmail.com sebsauvage at gmail.com
Fri Oct 3 16:46:31 EDT 2008


On 3 oct, 20:17, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
> > sebsauv... at gmail.com wrote:
> >> I'm using SimpleHTTPServer (work well) but it always sends "Server"
> >> header in response:
> >> How can I remove that ?
>
> En Fri, 03 Oct 2008 11:11:34 -0300, Gary M. Josack <g... at byoteki.com>  
> escribió:
>
> > you've got ?self.send_header('Server', self.version_string()) in the  
> > send_response method of the BaseHTTPRequestHandler class in the  
> > BaseHTTPServer module. Long story, short, it's going to be a lot of work  
> > to get rid of.
>
> One can always write a customized RequestHandler, and just copy the  
> send_response method omiting the offending line. (Ok, you have to check  
> whether it still works with the next Python release... a warning triggered  
> by a new sys.version would be enough to remember that)

I see. No choice but to override the method with a copy of the
source :-/
I guess I'll have to do with that.

Thanks.





More information about the Python-list mailing list