Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the Server HTTP header exist?

Tags:

What is the Server HTTP response header useful for? I have yet to actually see a use for it. Why would someone that's requesting a webpage need to know what server a webpage is hosted on?

like image 575
Jason Baker Avatar asked May 09 '09 19:05

Jason Baker


People also ask

What is the purpose of the server header?

The Server header describes the software used by the origin server that handled the request — that is, the server that generated the response. Warning: Avoid overly-detailed Server values, as they can reveal information that may make it (slightly) easier for attackers to exploit known security holes.

Is server header mandatory?

HTTP headers re used to convey additional information between the client and the server. Although they are optional they make up the most of the http request and are almost always present.

Why is Host header mandatory?

If your question is "why specify the host in a Host header as opposed to on the Request-Line", the answer is the need for interopability between HTTP/1.0 and 1.1. If the question is "why is the Host header mandatory", this has to do with the desire to speed up the transition away from assigned IP addresses.


2 Answers

This has reminded me of the first HTTP server I wrote, which (obviously) returned the server header: Why do you want to know?

One possible answer to this question is "Because I'm doing a survey." For example, this would be impossible without the Server header.

like image 98
Daniel Earwicker Avatar answered Sep 30 '22 07:09

Daniel Earwicker


Server doesn't mean the server that the resource is served from. It's for advertising the implementation. As to its utility, that's a good question. Apache httpd can be configured not to include that header, since it can be considered a security issue.

like image 39
jabley Avatar answered Sep 30 '22 05:09

jabley