From e679b0241662ea7c1910b9fc02ed0cb8f59b0de6 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Wed, 11 Jan 2023 15:27:23 +0100 Subject: Test CGI --- plugins/cgi/cgi.cpp | 4 ++-- plugins/fcgi/fcgi.cpp | 2 +- plugins/static-files/static-files.cpp | 2 +- plugins/websocket/websocket.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp index 23c9bc4..0ad5e2b 100644 --- a/plugins/cgi/cgi.cpp +++ b/plugins/cgi/cgi.cpp @@ -196,7 +196,7 @@ namespace { std::string HttpStatus(std::string status, std::string message, std::function& SetResponseHeader) { SetResponseHeader("status", status); - SetResponseHeader("content_type", "text/html"); + SetResponseHeader("content_type", "text/plain"); return status + " " + message; } @@ -266,7 +266,7 @@ std::string cgi_plugin::generate_page( } try { - if ((fs::status(path).permissions() & fs::perms::others_exec) == fs::perms::none) { + if ((fs::status(path).permissions() & (fs::perms::owner_all | fs::perms::group_all | fs::perms::others_exec)) == fs::perms::none) { return HttpStatus("500", "Script not executable: "s + rel_target, SetResponseHeader); } } catch (const std::exception& ex) { diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp index f2743c3..95f03f6 100644 --- a/plugins/fcgi/fcgi.cpp +++ b/plugins/fcgi/fcgi.cpp @@ -310,7 +310,7 @@ namespace { std::string HttpStatus(std::string status, std::string message, std::function& SetResponseHeader) { SetResponseHeader("status", status); - SetResponseHeader("content_type", "text/html"); + SetResponseHeader("content_type", "text/plain"); return status + " " + message; } diff --git a/plugins/static-files/static-files.cpp b/plugins/static-files/static-files.cpp index 4dd8499..e9cff0f 100644 --- a/plugins/static-files/static-files.cpp +++ b/plugins/static-files/static-files.cpp @@ -46,7 +46,7 @@ fs::path extend_index_html(fs::path path) std::string HttpStatus(std::string status, std::string message, std::function& SetResponseHeader) { SetResponseHeader("status", status); - SetResponseHeader("content_type", "text/html"); + SetResponseHeader("content_type", "text/plain"); return status + " " + message; } diff --git a/plugins/websocket/websocket.cpp b/plugins/websocket/websocket.cpp index 884f691..c7119c6 100644 --- a/plugins/websocket/websocket.cpp +++ b/plugins/websocket/websocket.cpp @@ -23,7 +23,7 @@ namespace { std::string HttpStatus(std::string status, std::string message, std::function& SetResponseHeader) { SetResponseHeader("status", status); - SetResponseHeader("content_type", "text/html"); + SetResponseHeader("content_type", "text/plain"); return status + " " + message; } -- cgit v1.2.3