| 104 | } |
| 105 | |
| 106 | std::unique_ptr<StreamFilter> |
| 107 | getContentEncodingStreamFilter(HttpResponse* httpResponse, |
| 108 | std::unique_ptr<StreamFilter> delegate = nullptr) |
| 109 | { |
| 110 | if (httpResponse->isContentEncodingSpecified()) { |
| 111 | auto filter = httpResponse->getContentEncodingStreamFilter(); |
| 112 | if (!filter) { |
| 113 | A2_LOG_INFO(fmt("Content-Encoding %s is specified, but the current " |
| 114 | "implementation doesn't support it. The decoding " |
| 115 | "process is skipped and the downloaded content will be " |
| 116 | "still encoded.", |
| 117 | httpResponse->getContentEncoding().c_str())); |
| 118 | } |
| 119 | else { |
| 120 | filter->init(); |
| 121 | filter->installDelegate(std::move(delegate)); |
| 122 | return filter; |
| 123 | } |
| 124 | } |
| 125 | return delegate; |
| 126 | } |
| 127 | |
| 128 | } // namespace |
| 129 |
no test coverage detected