2 Content-Type values for the ajax call

#1
Hey guys,

I've been having some trouble with OpenLiteSpeed 1.4.23 Ajax calls returning 2 Content-Type values which causes my WHMCS client area to go hay-wire. I've also contacted WHMCS support in regards to this issue and they have recommended me to contact Litespeed in regards to the case as Apache isn't being affected this issue.

The expected Content-Type value in the ajax call response headers are:
Code:
Content-Type:application/json
However your server is returning:
Code:
content-type:text/html; charset=utf-8
content-type:application/json
Another user reported the same problem:
https://www.litespeedtech.com/support/forum/threads/litespeed-issue-with-json.6217/

Is there a way to stop Litespeed from serving the ajax content with the text/html content-type?

Thanks so much for any help and responses. :)
 
Last edited:

mistwang

LiteSpeed Staff
#3
If you build OLS from source, you can try the following patch
Code:
diff --git src/http/httpcgitool.cpp src/http/httpcgitool.cpp
index b7b22e6..cf82585 100644
--- src/http/httpcgitool.cpp
+++ src/http/httpcgitool.cpp
@@ -137,7 +137,7 @@ int HttpCgiTool::processHeaderLine(HttpExtConnector *pExtConn,
             str.append(pLineBegin, pLineEnd - pLineBegin);
             str.append(pCharset->c_str(), pCharset->len());
             str.append("\r\n", 2);
-            buf.parseAdd(str.c_str(), str.len(), LSI_HEADEROP_ADD);
+            buf.parseAdd(str.c_str(), str.len());
         }
         return 0;
     case HttpRespHeaders::H_CONTENT_ENCODING:
 
#5
Update: I've installed OLP from source with the above-mentioned patch. It's still serving the headers with 2 content-type.

Here's the headers as captured by Fiddler:


Damn... Any other possible solutions?
 
Last edited:
Top