mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
UI: Add alternate constructor for RemoteTextThread
Allows specifying extra headers.
This commit is contained in:
parent
44834bbf04
commit
08e6dcd516
@ -61,6 +61,9 @@ void RemoteTextThread::run()
|
||||
contentTypeString.c_str());
|
||||
}
|
||||
|
||||
for (std::string &h : extraHeaders)
|
||||
header = curl_slist_append(header, h.c_str());
|
||||
|
||||
curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER,
|
||||
header);
|
||||
|
@ -28,6 +28,8 @@ class RemoteTextThread : public QThread {
|
||||
std::string contentType;
|
||||
std::string postData;
|
||||
|
||||
std::vector<std::string> extraHeaders;
|
||||
|
||||
int timeoutSec = 0;
|
||||
|
||||
void run() override;
|
||||
@ -46,6 +48,19 @@ public:
|
||||
postData (postData_),
|
||||
timeoutSec (timeoutSec_)
|
||||
{}
|
||||
|
||||
inline RemoteTextThread(
|
||||
std::string url_,
|
||||
std::vector<std::string> &&extraHeaders_,
|
||||
std::string contentType_ = std::string(),
|
||||
std::string postData_ = std::string(),
|
||||
int timeoutSec_ = 0)
|
||||
: url (url_),
|
||||
contentType (contentType_),
|
||||
postData (postData_),
|
||||
extraHeaders (std::move(extraHeaders_)),
|
||||
timeoutSec (timeoutSec_)
|
||||
{}
|
||||
};
|
||||
|
||||
bool GetRemoteFile(
|
||||
|
Loading…
Reference in New Issue
Block a user