Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

net::ERR_INCOMPLETE_CHUNKED_ENCODING

I use .htaccess to rewrite url from someurl.com/ to someurl.com/public/. First .htaccess in www root contains this:

DirectoryIndex ./public/
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./public/$1  [QSA]

and second one in folder /public/ contains this:

DirectoryIndex _main.php
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./?params=$1 [QSA]

And the problem is when I open url someurl.com/ without "public". Page is loaded correctly, but in Google Chrome console I got error: net::ERR_INCOMPLETE_CHUNKED_ENCODING. When I open url someurl.com/public/ page loads without any error.

Any ideas, please?

like image 555
Mathew Wolf Avatar asked Apr 22 '14 11:04

Mathew Wolf


2 Answers

In my case, the problem was cache-related and was happening when doing a CORS request.

I post my response here cause this is the first resource I found on Google for net::ERR_INCOMPLETE_CHUNKED_ENCODING error.

Forcing the response header Cache-Control to no-cache resolved my issue:

[ using Symfony HttpFoundation component ]

<?php
$response->headers->add(array(
   'Cache-Control' => 'no-cache'
));
like image 64
eightyfive Avatar answered Oct 18 '22 14:10

eightyfive


I had this issue when trying to access some parts of the WP admin area, I managed to resolve it by adding the below to my functions.php file;

add_filter('wp_headers', 'wpse167128_nocache');
function wpse167128_nocache($headers){
    unset($headers['Cache-Control']);
    return $headers;
}
like image 45
Dan Norris Avatar answered Oct 18 '22 13:10

Dan Norris