473,804 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[BaseHTTPServer/SimpleHTTPServe r] Remove "Server:" header

Hello.
I'm using SimpleHTTPServe r (work well) but it always sends "Server"
header in response:
"Server: SimpleHTTP/0.6 Python/2.5.1"

How can I remove that ?

I tried:
self.server_ver sion = ""
self.sys_versio n = ""

but the header is still sent, empty.

I there a way to remove the "Server:" header completely ?

Thanks.
Oct 3 '08 #1
4 5881
you've got ?self.send_head er('Server', self.version_st ring()) in the
send_response method of the BaseHTTPRequest Handler class in the
BaseHTTPServer module. Long story, short, it's going to be a lot of work
to get rid of.

se********@gmai l.com wrote:
Hello.
I'm using SimpleHTTPServe r (work well) but it always sends "Server"
header in response:
"Server: SimpleHTTP/0.6 Python/2.5.1"

How can I remove that ?

I tried:
self.server_ver sion = ""
self.sys_versio n = ""

but the header is still sent, empty.

I there a way to remove the "Server:" header completely ?

Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Oct 3 '08 #2
se********@gmai l.com wrote:
>I'm using SimpleHTTPServe r (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 <ga**@byoteki.c om>
escribió:
you've got ?self.send_head er('Server', self.version_st ring()) in the
send_response method of the BaseHTTPRequest Handler 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)

--
Gabriel Genellina

Oct 3 '08 #3
On 3 oct, 20:17, "Gabriel Genellina" <gagsl-...@yahoo.com.a rwrote:
sebsauv...@gmai l.com wrote:
I'm using SimpleHTTPServe r (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...@byoteki.c om*
escribió:
you've got ?self.send_head er('Server', self.version_st ring()) in the *
send_response method of the BaseHTTPRequest Handler 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.
Oct 3 '08 #4
En Fri, 03 Oct 2008 17:46:31 -0300, se********@gmai l.com
<se********@gma il.comescribió:
On 3 oct, 20:17, "Gabriel Genellina" <gagsl-...@yahoo.com.a rwrote:
sebsauv...@gmai l.com wrote:
I'm using SimpleHTTPServe r (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...@byoteki.c om*
escribió:
you've got ?self.send_head er('Server', self.version_st ring()) in the *
send_response method of the BaseHTTPRequest Handler 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_respons e 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.
Another alternative would be to override send_header() and filter out the
'Server' keyword...

--
Gabriel Genellina

Oct 3 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9388
by: Michael | last post by:
There seem to be two ways to include files on the server: 1. <!-- #include file="header.inc" --> 2. <script language="VBScript" runat="server" src="header.inc"></script> What are the differences between the two, and when to use one instead of the other? Thanks.
2
8407
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
2
294
by: Lubomir | last post by:
Hi, I have a BoundColumn in a DataGrid: <asp:BoundColumn DataField="lastname" SortExpression="lastname" ReadOnly="True" HeaderText="Last Name"></asp:BoundColumn> Column is sorted. I am wondering why this code is working properly as there is missing the statement runat="server".
2
6172
by: Miguel Dias Moura | last post by:
Hello, I have this line: <div runat="server" id="category-header"> I get this error: 'category-header' is not a valid identifier. When I use: <div runat="server" id="category-header">
3
6046
by: ADavidson | last post by:
I'm getting a {"Parser Error: The Runat attribute must have the value Server." } error when I try to get the Server.GetlastError() in the Global.asax codebehind. Why am I getting this? I tried to remove the code-behind and add the <script language="C#" runat="server"> but that fails as well. The code is simply:
3
3498
by: Jim in Arizona | last post by:
Most of the asp.net learning I've done has been from books that were written during the 1.0 framework. I didn't have a copy of visual studio when I started reading them then I got a hold of VS 2005 Beta 1, then Beta 2. I was using the <div runat="server"> statement on my projects. Once I placed a <div id="testdiv" runat="server"> within my aspx page, I could then manipulate it in the code behind like so: testdiv.visible = true...
7
5080
by: DC | last post by:
Hi, there is a 500;13 page one can configure in the website properties, but ..Net Framework 1.1 also delivers the "server too busy" message sometimes and the IIS custom error page does not seem to catch that. How would I customize the error page then? Regards DC
0
1906
by: Danigan | last post by:
Is there a way I can set up Apache to put incoming emails into a folder as individual text files (MIME, text, or I guess it'd be cool if Apache has a module to throw it into a database like mySQL with header info already parsed) with no actual complicated mail server installed? I don't need POP3, IMAP, or even SMTP. The idea is that I'll then write a program myself (probably in c++ and running on a crontab) that parses the emails and if it finds...
19
11256
by: Scott M. | last post by:
Why do we need runat="server" on our <headtags?
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.