Skip to content
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

Invalid Content-Type #23

Closed
svperfecta opened this issue Sep 9, 2012 · 2 comments
Closed

Invalid Content-Type #23

svperfecta opened this issue Sep 9, 2012 · 2 comments

Comments

@svperfecta
Copy link
Contributor

I'm using the Server module using the example on the PIPE homepage. I'm having a strange problem. No matter what I do I'm getting a content type back of text/html. I'm using PHP 5.3.16 (installed via homebrew-php), NGINX, and FPM.

First, the file:

$ curl http://localhost:8081/assets.php/init.css                                                                                               
.test{}

And here are the headers:

$ curl -I http://localhost:8081/assets.php/init.css
HTTP/1.1 200 OK                                                                                   
Server: nginx/1.2.3                                                                               
Date: Sun, 09 Sep 2012 04:24:56 GMT                                                               
Content-Type: text/html                                                                           
Connection: keep-alive                                                                            
X-Powered-By: PHP/5.3.16 

Here's my NGINX config (pretty vanilla):

# Apollo-JS
server {
    listen       8081;
    server_name  localhost;
    root   /my/home/folder/web;

    location / {
        try_files $uri /index.html;
    }
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ ^/.*\.php(/|$) {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO         $fastcgi_path_info;
        fastcgi_param HTTPS             off;
    }
}

If I echo the response object in my assets.php file I get:

HTTP/1.0 200 OK                                                                                
Cache-Control: public                                                                          
Content-Type:  text/css; charset=UTF-8                                                         
Date:          Sun, 09 Sep 2012 04:32:21 GMT                                                   
Last-Modified: Sun, 09 Sep 2012 00:53:32 GMT    

I can't see anything wrong anywhere. NGINX isn't touching the headers, PHP-FPM doesn't seem to have any option to manipulate them even if I wanted to, and PHP seems to be sending them correctly. I was wondering if I was missing something obvious?

@svperfecta
Copy link
Contributor Author

Any chance someone else could see if they are getting the same thing? It happens to me for JS files too.

@svperfecta
Copy link
Contributor Author

I found this bug late last night. It was in PAKE. I found it by doing:

if (headers_sent($filename, $linenum)) {
echo "Headers already sent in $filename on line $linenum\n";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant