The client is requesting an image:
GET /api/2.0/users/80.png HTTP/1.1
Host: learnwithecho.com
Proxy-Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: image/* <------------------------------ HERE'S THE IMPORTANT PART
Accept-Language: en-us
Connection: keep-alive
User-Agent: Echo/1.0.16.1 CFNetwork/672.0.2 Darwin/12.5.0
And I have a script at api/2.0/users.php (yes, PATH_INFO is on)
...
header('Content-Type: image/png');
$user = User::getUserWithID($filename);
header("Location: ".$user->getImageURL());
exit(0);
But Apache or PHP is trying to act like it knows me... and it don't. It assumes a PHP script couldn't possibly want to respond with a image/png and it throws a 406 Not Acceptable
error.
Can I successfully configure Apache/PHP to respond to this request?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…