Skip to content

Commit

Permalink
extinfo.cgi does not set content-type (most cgi's don't)
Browse files Browse the repository at this point in the history
Fix for issue http://tracker.nagios.org/view.php?id=628

The issue was written specifically for extinfo.cgi, but most of the
cgi programs did not include the 'charset' parameter. So I added
'charset=utf-8' to all 'content-type' headers.
  • Loading branch information
John C. Frickson committed Sep 7, 2016
1 parent d803256 commit b2c1ae0
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ FIXES
* Service Parents does not appear to be functioning as intended (lev)
* Availability report mixes up scheduled and unscheduled warning percentages (Helmut Mikulcik)
* Remove deprecated "framespacing" (John Frickson)
# The nagios tarball contains two identical jquery copies (John Frickson)
* The nagios tarball contains two identical jquery copies (John Frickson)
* extinfo.cgi does not set content-type (most cgi's don't) (John Frickson)


4.2.1 - 2016-09-06
Expand Down
2 changes: 1 addition & 1 deletion cgi/avail.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ void document_header(int use_stylesheet) {
printf("Expires: %s\r\n", date_time);

if(output_format == HTML_OUTPUT)
printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");
else {
printf("Content-type: text/csv\r\n\r\n");
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void document_header(int use_stylesheet) {

else {

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

printf("<html>\n");
printf("<head>\n");
Expand Down
2 changes: 1 addition & 1 deletion cgi/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void document_header(int use_stylesheet) {
printf("Pragma: no-cache\r\n");
printf("Last-Modified: %s\r\n", date_time);
printf("Expires: %s\r\n", date_time);
printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

printf("<html>\n");
printf("<head>\n");
Expand Down
2 changes: 1 addition & 1 deletion cgi/extinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/histogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/notifications.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/outages.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/showlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/statusmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-Type: text/html\r\n\r\n");
printf("Content-Type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ void document_header(int use_stylesheet) {
printf("Expires: %s\r\n", date_time);

if(output_format == HTML_OUTPUT)
printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");
else {
printf("Content-type: text/plain\r\n\r\n");
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/tac.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down
2 changes: 1 addition & 1 deletion cgi/trends.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ void document_header(int use_stylesheet) {
get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
printf("Expires: %s\r\n", date_time);

printf("Content-type: text/html\r\n\r\n");
printf("Content-type: text/html; charset=utf-8\r\n\r\n");

if(embedded == TRUE)
return;
Expand Down

0 comments on commit b2c1ae0

Please sign in to comment.