| 827 | } |
| 828 | |
| 829 | void HttpRequestTest::testAcceptMetalink() |
| 830 | { |
| 831 | auto request = std::make_shared<Request>(); |
| 832 | request->setUri("http://localhost/archives/aria2-1.0.0.tar.bz2"); |
| 833 | |
| 834 | HttpRequest httpRequest; |
| 835 | httpRequest.disableContentEncoding(); |
| 836 | httpRequest.setRequest(request); |
| 837 | httpRequest.setAuthConfigFactory(authConfigFactory_.get()); |
| 838 | httpRequest.setOption(option_.get()); |
| 839 | httpRequest.setAcceptMetalink(true); |
| 840 | httpRequest.setNoWantDigest(true); |
| 841 | |
| 842 | std::string expectedText = |
| 843 | "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" |
| 844 | "User-Agent: aria2\r\n" |
| 845 | "Accept: */*,application/metalink4+xml,application/metalink+xml\r\n" |
| 846 | "Host: localhost\r\n" |
| 847 | "Pragma: no-cache\r\n" |
| 848 | "Cache-Control: no-cache\r\n" |
| 849 | "Connection: close\r\n" |
| 850 | "\r\n"; |
| 851 | |
| 852 | CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest()); |
| 853 | } |
| 854 | |
| 855 | void HttpRequestTest::testEnableAcceptEncoding() |
| 856 | { |
nothing calls this directly
no test coverage detected