mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-05 23:18:32 +00:00
Include Content-Transfer-Encoding in uploads.
We should specify it's binary, otherwise proxies might munge the data.
This commit is contained in:
parent
da0a79f695
commit
347158ecc6
@ -4,6 +4,7 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdarg>
|
||||
#include <vector>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
@ -145,12 +146,18 @@ struct MultipartFormDataEncoder : UrlEncoder
|
||||
char temp[64];
|
||||
snprintf(temp, sizeof(temp), "Content-Length: %d\r\n", (int)value.size());
|
||||
data += temp;
|
||||
data += "Content-Transfer-Encoding: binary\r\n";
|
||||
data += "\r\n";
|
||||
|
||||
data += value;
|
||||
data += "\r\n";
|
||||
}
|
||||
|
||||
void Add(const std::string &key, const std::vector<uint8_t> &value, const std::string &filename, const std::string &mimeType)
|
||||
{
|
||||
Add(key, std::string((const char *)&value[0], value.size()), filename, mimeType);
|
||||
}
|
||||
|
||||
virtual void Finish()
|
||||
{
|
||||
data += "--" + boundary + "--";
|
||||
|
Loading…
x
Reference in New Issue
Block a user