我的服务器正在向请求发送带有正文的示例响应标头:
static char* not_found_response_template =
"HTTP/1.1 404 Not Found\n"
"Content-type: text/html\n"
"\n"
"<html>\n"
" <body>\n"
" <h1>Not Found</h1>\n"
" <p>The requested URL was not found on this server.</p>\n"
" </body>\n"
"</html>\n";
len = strlen(not_found_response_template);
send(newSct, not_found_response_template, len, 0);
它发送正确,但 Firefox 继续加载,直到我取消传输。
Firefox 插件 HttpRequestHelper 显示了这一点:
获取本地主机:6666
-- 响应 -- 404 Not Found Content-Type: text/html
为什么内容没有加载?