2012-07-06 93 views
0

我们的一些设备(与SIM卡,它的调制解调器)的recieving从我们的服务器这个HTTP响应:Controling HTTP响应

HTTP/1.1 200 OK\r\nCache-Control: no-cache\r\nConnection: close\r\nContent-Length: 686\r\n 
Content-Type: application/vnd.wap.xhtml+xml\r\n 
Date: Thu, 05 Jul 2012 15:04:21 GMT\r\n 
Vary: Accept-Encoding\r\n\r\n 
<?xml version="1.0"?>\n<!DOCTYPE html PUBLIC"-//WAPFORUM//DTD XHTML Mobile 1.0//EN" \n 
    "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >\n\n 
<html xmlns="http://www.w3.org/1999/xhtml">\n <head>\n 
     <title>* Error *</title>\n 
     <!-- \n 
      Change href="style.css" below to the file name and\n 
      relative path or URL or URL 
of your external style sheet.\n 
      --> \n 
     <!-- \n 
     <link rel="stylesheet" href="style.css" type="text/css"/>\n 
     <style> document-wide styles would go here </style>\n 
     -->\n 
    </head>\n 
    <body>\n 
     <h1>Sorry</h1>\n\t\t<ul>\n\t\t The requested item could not be loaded!<br/>(Status Code: 500)\n\t\t</ul>\t \n\t</body>\n</html>\n 

,它是造成问题的设备,因为他们无法解析此响应。他们期待500个代码(服务器错误),因为发送了错误的请求,并且我确信apache服务器正在发送500个代码?

预期的反应是这样的:

HTTP/1.0 500 Internal Server Error\r\n\ 

Date: Thu, 05 Jul 2012 14:16:23 GMT\r\n 
Server: Apache/2.2.20 (Ubuntu) 

Vary: Accept-Encoding.. 

Content-Length: 0\r\n 
Connection: close\r\n 
Content-Type: text/html\r\n 

是否有可能移动网关发送对此有何反应?我的意思是,网关改变了回应? 如何避免这种情况,或者我需要做些什么来确保已发送的响应正在客户端接收。

在此先感谢和抱歉,我的英语不好

回答

0

看来你正在访问的服务器使用的ErrorDocument指令。它所做的不是输出一个纯HTTP 500错误,而是会吐出一个描述错误的用户友好页面。你能分享你想要获得的网页的确切网址吗?