Problems with HTTP/2

Sergey Kandaurov pluknet at nginx.com
Tue Sep 29 10:38:04 UTC 2015


On Sep 29, 2015, at 12:25 PM, Francis Daly <francis at daoine.org> wrote:
> On Tue, Sep 29, 2015 at 01:06:50AM +0300, Aapo Talvensaari wrote:
>> On 29 September 2015 at 00:01, Valentin V. Bartenev <vbart at nginx.com> wrote:
>>>> On Monday 28 September 2015 20:59:23 Aapo Talvensaari wrote:
>>>>> 
>>>>> <?php
>>>>> header(':', true, 403);
>>>>> die(json_encode(array( ... )));
>>>> 
>>>> What does ":" mean in the header() function?
>>>> If it returns ":" as a header, then it's the cause of the error.
>>> 
>>> It just sets the status code. It is normal PHP 5.3 code [1]. I might need
>> to compile nginx by hand to get more debug info.
> 
> For what it's worth:
> 
> when I test with a php 5.1.6 and a php 5.3.3,
> 
>  header(':', true, 403);
> 
> sets the status code and adds a header called :.
> 
> So the end of the http header looks like
> 
>  X-Powered-By: PHP/5.3.3
>  ::
> 
> with the debug log showing
> 
>  http fastcgi header: "X-Powered-By: PHP/5.3.3"
>  http fastcgi parser: 0
>  http fastcgi header: ":: "

So, the header field name output as generated with php
(and previously guessed by Valentin),
is invalid as per 7230, which is in turn referenced in 7540.

:   field-name = token
:   token = 1*tchar
:   tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
:    "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA

Not much to discuss.

-- 
Sergey Kandaurov



More information about the nginx mailing list