3
0
Fork 0

+ bug fix, first time the webserver really runs

small_fixes
kelson42 16 years ago
parent 75995a8b2d
commit 4528502269

@ -106,12 +106,6 @@ static int accessHandlerCallback(void *cls,
/* Get the content mime-type */
mimeType = article.getMimeType();
cout << "mimeType: " << mimeType << endl;
/* Snapshot if text/html */
if (mimeType == "text/html") {
cout << "Snapshot: " << content.substr(0, 42) << endl;
mimeType = mimeType + "; charset=utf-8";
}
} else {
/* The found article is not the good one */
content="";
@ -132,7 +126,7 @@ static int accessHandlerCallback(void *cls,
response = MHD_create_response_from_data(contentLength,
(void *)content.data(),
MHD_NO,
MHD_NO);
MHD_YES);
/* Specify the mime type */
MHD_add_response_header(response, "Content-Type", mimeType.c_str());
@ -142,6 +136,7 @@ static int accessHandlerCallback(void *cls,
MHD_HTTP_OK,
response);
MHD_destroy_response(response);
return ret;
}

Loading…
Cancel
Save