Headers::send() added ":" to modified Status header. #12179

Closed
dimak08 opened this Issue Aug 30, 2016 · 13 comments

Projects

None yet

5 participants

@dimak08
dimak08 commented Aug 30, 2016

$response->setStatusCode(304) add ":" to end of status header

$response = new \Phalcon\Http\Response();
$response->setStatusCode(304);
$response->sendHeaders();

2016-08-30 12 46 25

Details

  • Phalcon version: 3.0.0
  • PHP Version: 7.0.10
@Jurigag
Contributor
Jurigag commented Aug 30, 2016

Yea, i have this too.

@sergeyklay sergeyklay self-assigned this Aug 30, 2016
@sergeyklay sergeyklay added this to the 3.0.2 milestone Aug 30, 2016
@stamster

This is only case with 304 HTTP status? I'm heavily using setStatusCode() method, and never had such issue with 4xx, 5xx or 3xx status codes.

@dimak08
dimak08 commented Aug 30, 2016

With all statuses except 200

30 авг. 2016 г. 16:13 пользователь "stamster" notifications@github.com
написал:

This is only case with 304 HTTP status? I'm heavily using setStatusCode()
method, and never had such issue with 4xx, 5xx or 3xx status codes.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#12179 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE9Ktr87fmV5mbnk3SrgyxQQXn9ubcq0ks5qlCxggaJpZM4JwWAt
.

@stamster

You're correct.

HTTP/1.1 404 Not Found:
Server: nginx
Date: Tue, 30 Aug 2016 13:20:05 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 160
Connection: keep-alive

This is stupid bug. xD

@stamster

Response object is set correctly, var_dump($this->response->getStatusCode());

string(24) "422 Unprocessable Entity"

@phalcon phalcon pushed a commit that referenced this issue Aug 30, 2016
@andresgutierrez andresgutierrez Fixes #12179 cc478a4
@andresgutierrez
Collaborator

Fixed in 3.0.x branch

@stamster

@dimak08 I just wanted to point out the same code line number :) You were faster 👍

But, really if you look at code this does not look as a bug as someone obviously put effort to make sure : will be present on each http status message?! I wonder why.

@stamster

When we can expect 3.0.2 to be released in order to fix this issue?
@andresgutierrez @sergeyklay

@sergeyklay sergeyklay added a commit to sergeyklay/cphalcon that referenced this issue Sep 27, 2016
@andresgutierrez @sergeyklay andresgutierrez + sergeyklay Fixes #12179 5da44f8
@stamster
stamster commented Sep 27, 2016 edited

It would be nice if we could have quick fix for this issue, since it may block some ancient environments (Java 1.6 xD) which refuse to work if they don't find <CR><LF> after HTTP status response.

@sergeyklay
Collaborator

@stamster
Could you please check 3.0.x branch?

git clone git@github.com:phalcon/cphalcon.git
cd cphalcon
git checkout 3.0.x

zephir fullclean
zephir build
@Jurigag
Contributor
Jurigag commented Sep 27, 2016

It's already fixed in 3.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment