网:: ERR_INCOMPLETE_CHUNKED_ENCODING [英] net::ERR_INCOMPLETE_CHUNKED_ENCODING
问题描述
我用的.htaccess重写URL从someurl.com/到someurl.com/public/~~V。在WWW根第一的.htaccess包含这样的:
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]
和问题是,当我打开网址someurl.com/没有公共。页面加载正确的,但在谷歌浏览器控制台我得到错误:网:: ERR_INCOMPLETE_CHUNKED_ENCODING。当我打开URL someurl.com/public/页面加载没有任何错误。
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.
任何想法,请?
推荐答案
在我的情况下,这个问题是缓存相关的和正在发生的事情做了CORS请求时。
In my case, the problem was cache-related and was happening when doing a CORS request.
我后我的反应会导致在这里,这是我发现在谷歌的第一个资源网:: ERR_INCOMPLETE_CHUNKED_ENCODING
错误。
I post my response here cause this is the first resource I found on Google for net::ERR_INCOMPLETE_CHUNKED_ENCODING
error.
强制响应头的Cache-Control
到无缓存
解决我的问题:
Forcing the response header Cache-Control
to no-cache
resolved my issue:
[使用Symfony的 HttpFoundation 成分]
[ using Symfony HttpFoundation component ]
<?php
$response->headers->add(array(
'Cache-Control' => 'no-cache'
));
这篇关于网:: ERR_INCOMPLETE_CHUNKED_ENCODING的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!