http代理javascript注入
我有一个简单的 C++ 代理源。我正在尝试修改它以将一些 html 内容注入到特定页面中。我已经设法让它工作,但是每当我注入一些东西时,原始 html 的一部分就会被损坏。我知道这不是我的字符串处理函数,因为我让它在发送之前打印出结果,这很好。 html 一次传输 1460 个字节,每个块的顶部有一个 3 个字符的字符串,后面跟着换行符,最后有一个换行符和一个 0;
示例:
fef
some html
co7
some html
81f
final html
0
我一直在搜索并试图找出这三个字符代表什么。剩余内容长度十六进制?也许某种哈希?但我找不到任何东西。但我猜他们是问题的根源。任何帮助/见解表示赞赏。
I have a simple proxy source in C++. I'm trying to modify it to inject some html content into specific pages. I'v managed to get it working but whenever I inject something, part of the original html gets corrupted. I know for a fact that it's not my string handling functions because I have it printing out the result before sending and it's fine. The html is transmitted 1460 bytes at a time and there is a 3 character string followed newline at the top of each chunk and then at the very end there is a newline and a 0;
Example:
fef
some html
co7
some html
81f
final html
0
Iv been searching and trying to figure out what those three characters represent. Remaining content length hexed? maybe some sort of hash? but I can't find anything. But I'm guessing they're the source of the problem. Any help/insight is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
分块编码?请参阅 RFC 2616 第 3.6.1 节。
Chunked Encoding? See RFC 2616, Section 3.6.1.
您代理的服务器是否在标头中指定了响应的大小?如果是这样,并且您正在修改响应正文而不更新标头,则可能会遇到类似这样的奇怪错误。
Is the server you are proxying specifying the size of the response in a header? If so, and you're modifying the response body without updating the header, you might get strange errors like this one.