feat: Respect the file mode for HttpFiles (#1081)
For a read mode, make a GET request. Otherwise, make a PUT request.
This commit is contained in:
parent
868208198a
commit
31e116faec
|
@ -106,13 +106,19 @@ File* CreateUdpFile(const char* file_name, const char* mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
File* CreateHttpsFile(const char* file_name, const char* mode) {
|
File* CreateHttpsFile(const char* file_name, const char* mode) {
|
||||||
UNUSED(mode); // TODO: choose method based on file mode
|
HttpMethod method = HttpMethod::kGet;
|
||||||
return new HttpFile(HttpMethod::kPut, std::string("https://") + file_name);
|
if (strcmp(mode, "r") != 0) {
|
||||||
|
method = HttpMethod::kPut;
|
||||||
|
}
|
||||||
|
return new HttpFile(method, std::string("https://") + file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
File* CreateHttpFile(const char* file_name, const char* mode) {
|
File* CreateHttpFile(const char* file_name, const char* mode) {
|
||||||
UNUSED(mode); // TODO: choose method based on file mode
|
HttpMethod method = HttpMethod::kGet;
|
||||||
return new HttpFile(HttpMethod::kPut, std::string("http://") + file_name);
|
if (strcmp(mode, "r") != 0) {
|
||||||
|
method = HttpMethod::kPut;
|
||||||
|
}
|
||||||
|
return new HttpFile(method, std::string("http://") + file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
File* CreateMemoryFile(const char* file_name, const char* mode) {
|
File* CreateMemoryFile(const char* file_name, const char* mode) {
|
||||||
|
|
Loading…
Reference in New Issue