protocol: provide default response code for custom request jobs
This commit is contained in:
parent
190c9c916e
commit
3c88447be6
3 changed files with 43 additions and 4 deletions
|
@ -82,6 +82,9 @@ class JsAsker : public RequestJob {
|
|||
base::Bind(&JsAsker::OnResponse,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
}
|
||||
|
||||
int GetResponseCode() const override { return 200; }
|
||||
|
||||
void GetResponseInfo(net::HttpResponseInfo* info) override {
|
||||
info->headers = new net::HttpResponseHeaders("");
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ void URLRequestBufferJob::StartAsync(std::unique_ptr<base::Value> options) {
|
|||
}
|
||||
|
||||
void URLRequestBufferJob::GetResponseInfo(net::HttpResponseInfo* info) {
|
||||
std::string status("HTTP/1.1 ");
|
||||
std::string status("HTTP/1.1 200 OK");
|
||||
status.append(base::IntToString(status_code_));
|
||||
status.append(" ");
|
||||
status.append(net::GetHttpReasonPhrase(status_code_));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue