stephb9959
2023-03-13 10:01:46 -07:00
parent 00698ce31c
commit a196e03c8e
4 changed files with 6 additions and 4 deletions

View File

@@ -614,7 +614,7 @@ namespace OpenWifi {
std::stringstream ParamStream;
Params.stringify(ParamStream);
Cmd.Details = ParamStream.str();
FileUploader()->AddUUID(CMD_UUID, 15min, SCR.type == "shell" ? "txt" : "gzip" );
FileUploader()->AddUUID(CMD_UUID, 15min, SCR.type == "shell" ? "txt" : "tgz" );
return RESTAPI_RPC::WaitForCommand(CMD_RPC, APCommands::Commands::script, false, Cmd,
Params, *Request, *Response, timeout, nullptr, this,

View File

@@ -28,8 +28,8 @@ namespace OpenWifi {
if (FileType == "pcap") {
SendFileContent(FileContent, "application/vnd.tcpdump.pcap", UUID + ".pcap");
}
else if (FileType == "gzip") {
SendFileContent(FileContent, "application/gzip", UUID + ".tar.gz");
else if (FileType == "tgz" ) {
SendFileContent(FileContent, "application/gzip", UUID + ".tgz");
}
else if (FileType == "txt") {
SendFileContent(FileContent, "txt/plain", UUID + ".txt");

View File

@@ -483,6 +483,7 @@ namespace OpenWifi {
Response->set("Content-Transfer-Encoding", "binary");
Response->set("Accept-Ranges", "bytes");
}
Response->set("Access-Control-Expose-Headers", "Content-Disposition");
Response->set("Content-Disposition", "attachment; filename=" + Name);
Response->set("Accept-Ranges", "bytes");
Response->set("Cache-Control", "no-store");
@@ -500,6 +501,7 @@ namespace OpenWifi {
Response->set("Content-Transfer-Encoding", "binary");
Response->set("Accept-Ranges", "bytes");
}
Response->set("Access-Control-Expose-Headers", "Content-Disposition");
Response->set("Content-Disposition", "attachment; filename=" + Name);
Response->set("Accept-Ranges", "bytes");
Response->set("Cache-Control", "no-store");

View File

@@ -443,7 +443,7 @@ namespace OpenWifi::Utils {
return MediaTypeEncoding{.Encoding = PLAIN, .ContentType = "text/plain"};
if (E == "tgz")
return MediaTypeEncoding{.Encoding = BINARY, .ContentType = "application/tar+gzip"};
if (E == "gz")
if (E == "gz" || E=="gzip")
return MediaTypeEncoding{.Encoding = BINARY, .ContentType = "application/gzip"};
return MediaTypeEncoding{.Encoding = BINARY, .ContentType = "application/octet-stream"};