mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-01 19:28:01 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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"};
|
||||
|
||||
Reference in New Issue
Block a user