New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #23, thanks to @garoevans for reporting the issue, and fixing soon... #24
Conversation
…ooner than later
|
Good catch, and a good start. It needs to also check CONTENT_LENGTH and CONTENT_MD5. |
|
@pmjones done. Have a look. |
|
Argh -- I think this is in the wrong place. First off, look at https://tools.ietf.org/rfc/rfc3875.txt -- this is what PHP follows. There are no such keys as The issue appears to be in the "headers" class, not the "content" class. The loop there looks only for HTTP_* headers and does not track the CONTENT_* headers. Sorry for the back-and-forth, man. :-/ |
|
Here's another note about it: http://php.net/manual/en/reserved.variables.server.php#110763 |
|
I am running with php version 5.4, not sure your php version. The php's built in server when you have a I do believe that is true for This is my code <?php
require __DIR__ . '/vendor/autoload.php';
use Aura\Web\WebFactory;
$web_factory = new WebFactory($GLOBALS);
$request = $web_factory->newRequest();
echo "Hello :) " . $request->content->getType();
echo "<br />\n";
echo isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : ' none ';
echo "<br />\n";
echo isset($_SERVER['HTTP_CONTENT_TYPE']) ? $_SERVER['HTTP_CONTENT_TYPE'] : ' http none';
echo "<br />\n";
echo isset($_SERVER['CONTENT_MD5']) ? $_SERVER['CONTENT_MD5'] : ' none md5';
echo "<br />\n";When you use If it is then we have not fixed. Thanks |
I wonder if that's a bug in the PHP 5.4 server; the RFC states it should be CONTENT_TYPE and not HTTP_CONTENT_TYPE. Maybe we do need to make an allowance there, as you noted earlier. |
|
Yes, I'm seeing the behavior you described. I'm on PHP 5.4.22 -- you? |
|
Yes I am in PHP 5.4.22 . |
|
/me nods I ask because I went to report the bug, but they won't take bugs on anything other than the latest versions (5.4.24 in this case). I don't have the time to upgrade any time soon -- do you? |
|
Sorry I too don't think so :( . As this is built in server may be a note is good?. |
|
/me nods again OK, so I'll merge this change too, and that at least will make an allowance for the bug. Thanks man! |
|
I can confirm that php 5.5.3's built in web server does use HTTP_CONTENT_TYPE instead of CONTENT_TYPE. I just did a var_dump of $_SERVER with curl -H "Content-Type: application/json" http://localhost:8000, but without Aura.Web. |
|
Thank you @jelofson . |
|
Are you going to attempt to check for 'HTTP_CONTENT_TYPE' just for the use case, or not worth it? I'm only using the built in server for quick local setup purpose, but have the following in the top of my define.php: Maybe I should just take the 5 mins to setup a vhost for it on apache :) |
|
@garoevans as @pmjones mentioned the fix is only for built in server, but not sure whether it is worth. ( Reason explained by Paul ) |
|
This appears to be an issue with the PHP web server, not with Aura.Web per se. I have reported it to the PHP folks at https://bugs.php.net/bug.php?id=66606. I don't think it's worthwhile yet to "fix" this in Aura.Web just yet, but we can revisit that assessment later if we need to. |
|
Thanks Paul . |
|
I cleaned my branches again. That is why the branch got lost. Sorry. |
...er than later