Add UTF-8 charset to Content-Type HTTP headers
This commit is contained in:
parent
e7d449c83a
commit
87513aa8f8
|
@ -225,7 +225,7 @@ handle_upload( struct shttpd_arg * arg )
|
||||||
const char * response = "<result>success</result>";
|
const char * response = "<result>success</result>";
|
||||||
const int len = strlen( response );
|
const int len = strlen( response );
|
||||||
evbuffer_add_printf( cbuf->out, "HTTP/1.1 200 OK\r\n"
|
evbuffer_add_printf( cbuf->out, "HTTP/1.1 200 OK\r\n"
|
||||||
"Content-Type: text/xml\r\n"
|
"Content-Type: text/xml; charset=UTF-8\r\n"
|
||||||
"Content-Length: %d\r\n"
|
"Content-Length: %d\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"%s\r\n", len, response );
|
"%s\r\n", len, response );
|
||||||
|
@ -251,7 +251,7 @@ static void
|
||||||
handle_root( struct shttpd_arg * arg )
|
handle_root( struct shttpd_arg * arg )
|
||||||
{
|
{
|
||||||
const char * redirect = "HTTP/1.1 200 OK""\r\n"
|
const char * redirect = "HTTP/1.1 200 OK""\r\n"
|
||||||
"Content-Type: text/html" "\r\n"
|
"Content-Type: text/html; charset=UTF-8" "\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"<html><head>" "\r\n"
|
"<html><head>" "\r\n"
|
||||||
" <meta http-equiv=\"Refresh\" content=\"2; url=/transmission/web/\">" "\r\n"
|
" <meta http-equiv=\"Refresh\" content=\"2; url=/transmission/web/\">" "\r\n"
|
||||||
|
@ -301,7 +301,7 @@ handle_rpc( struct shttpd_arg * arg )
|
||||||
}
|
}
|
||||||
|
|
||||||
evbuffer_add_printf( cbuf->out, "HTTP/1.1 200 OK\r\n"
|
evbuffer_add_printf( cbuf->out, "HTTP/1.1 200 OK\r\n"
|
||||||
"Content-Type: application/json\r\n"
|
"Content-Type: application/json; charset=UTF-8\r\n"
|
||||||
"Content-Length: %d\r\n"
|
"Content-Length: %d\r\n"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"%*.*s", len, len, len, response );
|
"%*.*s", len, len, len, response );
|
||||||
|
|
Loading…
Reference in New Issue