L
L
luckyredhot2013-05-27 15:30:21
PHP
luckyredhot, 2013-05-27 15:30:21

Can all HTTP headers be changed at the code level?

Dear Khabrovites!

A practical question arose - is it absolutely possible to change all HTTP 1.1 headers at the code level ( PHP: header ), or are there those that are only returned by the server? If so, which ones.

Thanks in advance for your answers!

PS Dear minus and draining karma, please indicate the reason for downvoting and draining :) Thank you! ;)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
EugeneOZ, 2013-05-27
@luckyredhot

The answer is everything. Some can be overridden or added by PHP itself, some by the server (see settings).
In the request, those headers that came from the user are marked with the HTTP_ prefix in the $_SERVER array (they cannot be trusted, such as REMOTE_ADDR).

A
Alexey Akulovich, 2013-05-27
@AterCattus

Depends on SAPI implementation, as a call to header() eventually results in a call to the SAPI function header_handler. In PHP itself, there is nothing special about filtering ( here , here and here ).
And no one prevents frontend'u before php to influence the headers. For example in nginx .

V
Voffko, 2013-05-27
@Voffko

As far as I remember, all headers are under the programmer's control.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question