mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 07:17:53 +00:00
truncate url at '?' when serving htmls
This commit is contained in:
parent
22161a71ed
commit
ecd49d2fb2
@ -978,7 +978,12 @@ void ServiceConnection(AcceptedConnection *conn)
|
||||
|
||||
if (strURI != "/") {
|
||||
std::vector<char> file_data;
|
||||
if( load_file(strURI.c_str(), file_data) == 0 ) {
|
||||
std::string fname = strURI;
|
||||
size_t qMarkIdx = fname.find('?');
|
||||
if( qMarkIdx != string::npos ) {
|
||||
fname.resize(qMarkIdx);
|
||||
}
|
||||
if( load_file(fname.c_str(), file_data) == 0 ) {
|
||||
std::string str(file_data.data(), file_data.size());
|
||||
const char *contentType = "text/html";
|
||||
if( strURI.find(".js") != std::string::npos )
|
||||
|
Loading…
Reference in New Issue
Block a user