Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Change CURLOPT_POSTFIELDS into CURLOPT_COPYPOSTFIELDS
Browse files Browse the repository at this point in the history
  • Loading branch information
xlz-jbleclere committed Oct 29, 2020
1 parent 55db207 commit c2d9002
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/ws_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void CurlEasyPost::appendHeader( const std::string header ) {

void CurlEasyPost::setPostFields( const std::string& postfields ) {
curl_easy_setopt( mCurl, CURLOPT_POSTFIELDSIZE, postfields.size() );
curl_easy_setopt( mCurl, CURLOPT_POSTFIELDS, postfields.c_str() );
curl_easy_setopt( mCurl, CURLOPT_COPYPOSTFIELDS, postfields.c_str() );
}

uint32_t CurlEasyPost::perform( const std::string url, std::string* response, const int32_t timeout_sec ) {
Expand Down Expand Up @@ -236,8 +236,9 @@ void DrmWSClient::requestOAuth2token( const TClock::time_point deadline ) {
req.setVerbosity( mVerbosity );
req.setHostResolves( mHostResolvesJson );
std::stringstream ss;
ss << "client_id=" << mClientId << "&client_secret=" << mClientSecret;
ss << "&grant_type=client_credentials";
ss << "grant_type=client_credentials";
ss << "&client_id=" << mClientId;
ss << "&client_secret=" << mClientSecret;
req.setPostFields( ss.str() );

// Evaluate timeout with regard to the security limit
Expand Down

0 comments on commit c2d9002

Please sign in to comment.