Google的NaCL返回的响应标头不完整

时间:2016-09-14 02:49:20

标签: c++ google-chrome c++11 google-chrome-devtools google-nativeclient

Google的NaCL返回的响应标头不完整。我可以在Chrome开发者工具的网络选项卡中看到浏览器实际上收到了所有标题,但是NaCl在c ++代码中返回了不完整的标题。

我在Chrome网络标签中看到的标题:

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 3312
Connection: keep-alive
Date: Wed, 14 Sep 2016 02:12:37 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Last-Modified: Wed, 14 Sep 2016 02:12:37 GMT
ETag: "644c53b76e0fd646aad2f4aaf313067d"
x-amz-version-id: rMFIbU5ptnyKgwn1_YRNr5OkEkTT8cEV
Accept-Ranges: bytes
Server: AmazonS3
Vary: Origin
X-Cache: Miss from cloudfront
Via: 1.1 a75bbd1dd9f3f983d073b0972494851d.cloudfront.net (CloudFront)
X-Amz-Cf-Id: 41xr_GlfJLkZ_SszRBmy62jCVjQgCl9sgyHtusJjc95Tb91BISksyg==

我收到来自NaCL的c ++代码的标题:

Content-Type: application/octet-stream
Last-Modified: Wed, 14 Sep 2016 02:12:37 GMT

这是我如何访问和打印从NaCL收到的标题:

//Following is inside callback method passed to pp::URLLoader::Open method as second argument.

    auto response = _pLoader->GetResponseInfo();
    auto headers = response.GetHeaders().AsString();
    std::cout<< headers << std::endl;

问题:如何获取所有标题并打印出来?

0 个答案:

没有答案