使用错误页面中止HTTP块编码的响应 [英] Abort HTTP chunk encoded response with Error Page

查看:82
本文介绍了使用错误页面中止HTTP块编码的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在扩展上一个问题:中止HTTP/1.1块编码响应

I'm extending this previous question: Aborting a HTTP/1.1 chunk encoded response

当我中止响应时,Chrome显示空白页面,并且开发控制台报告net :: ERR_INCOMPLETE_CHUNKED_ENCODING. IE显示不完整的页面.有没有办法将用户引导到实际的500错误页面?

When I abort a chunked response Chrome displays a blank page and the dev console reports net::ERR_INCOMPLETE_CHUNKED_ENCODING. IE displays the incomplete page. Is there a way to send the user to an actual 500 error page?

我可以输出一些损坏文档的内容,以使浏览器无法使用它吗?如果是这样,我可以发送的最短字符串是什么?

Can I output something that corrupts the document so the browser won't use it? If so, what's the shortest string I can send to achieve this?

推荐答案

不幸的是,您无法发送对浏览器说嘿,忘记我到目前为止发送的所有内容-出问题了"的代码块.发送TCP重置数据包将使大多数浏览器显示服务器重置连接"页面,但这需要访问网络堆栈中的下一级.

Unfortunately, there is no chunk you can send that says to the browser "Hey, forget everything I sent so far - something went wrong". Sending a TCP reset packet will cause most browsers to display a "Server reset connection" page, but that requires access to one level down the network stack.

我唯一想到的就是尝试发送负长度的块.我不知道浏览器对此有何反应.

The only other I can think of is to try sending a chunk with a negative length. I don't know how browsers react to that.

这篇关于使用错误页面中止HTTP块编码的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆