Sends signed provisioning request as query string instead of payload.

Bug: 8790775

Merge of https://widevine-internal-review.googlesource.com/#/c/5381/
from the Widevine CDM repository.

Change-Id: I749303eee8162f37982f6dd5d83b6cf254b96847
This commit is contained in:
Jeff Tinker
2013-05-06 16:28:32 -07:00
parent 779b887bb3
commit d0f1784615
5 changed files with 26 additions and 27 deletions

View File

@@ -103,27 +103,21 @@ bool UrlRequest::PostRequest(const std::string& data) {
return true;
}
void UrlRequest::AppendData(const std::string& data) {
request_.append(data);
request_.append("\r\n"); // marks end of data
}
bool UrlRequest::PostCertRequest(const std::string& data) {
bool UrlRequest::PostCertRequestInQueryString(const std::string& data) {
request_.assign("POST /");
request_.append(socket_.resource_path());
request_.append("&signedRequest=");
request_.append(data);
request_.append(" HTTP/1.1\r\n");
request_.append("User-Agent: Widevine CDM v1.0\r\n");
request_.append("Host: ");
request_.append(socket_.domain_name());
request_.append("\r\nAccept: */*");
request_.append("\r\nContent-Type: application/json");
request_.append("\r\nContent-Length: ");
request_.append(UintToString(data.size()));
request_.append("\r\nContent-Length: 0");
request_.append("\r\n"); // empty line to terminate header
request_.append("\r\n"); // terminates the request
AppendData(data);
socket_.Write(request_.c_str(), request_.size());
return true;
}

View File

@@ -17,12 +17,11 @@ class UrlRequest {
~UrlRequest();
void AppendChunkToUpload(const std::string& data);
void AppendData(const std::string& data);
int GetResponse(std::string& response);
int GetStatusCode(const std::string& response);
bool is_connected() const { return is_connected_; }
bool PostRequest(const std::string& data);
bool PostCertRequest(const std::string& data);
bool PostCertRequestInQueryString(const std::string& data);
private:
static const unsigned int kHttpBufferSize = 4096;