2020-03-06 14:18:14 +00:00
|
|
|
#include <catch_main.hpp>
|
|
|
|
|
|
|
|
#include "slic3r/Utils/Http.hpp"
|
|
|
|
|
2020-11-25 12:56:57 +00:00
|
|
|
TEST_CASE("Check SSL certificates paths", "[Http][NotWorking]") {
|
2020-03-06 14:18:14 +00:00
|
|
|
|
|
|
|
Slic3r::Http g = Slic3r::Http::get("https://github.com/");
|
|
|
|
|
|
|
|
unsigned status = 0;
|
|
|
|
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.perform_sync();
|
|
|
|
|
|
|
|
REQUIRE(status == 200);
|
|
|
|
}
|
|
|
|
|
2020-11-25 12:56:57 +00:00
|
|
|
TEST_CASE("Http digest authentication", "[Http][NotWorking]") {
|
|
|
|
Slic3r::Http g = Slic3r::Http::get("https://jigsaw.w3.org/HTTP/Digest/");
|
|
|
|
|
|
|
|
g.auth_digest("guest", "guest");
|
|
|
|
|
|
|
|
unsigned status = 0;
|
|
|
|
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.perform_sync();
|
|
|
|
|
|
|
|
REQUIRE(status == 200);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_CASE("Http basic authentication", "[Http][NotWorking]") {
|
|
|
|
Slic3r::Http g = Slic3r::Http::get("https://jigsaw.w3.org/HTTP/Basic/");
|
|
|
|
|
|
|
|
g.auth_basic("guest", "guest");
|
|
|
|
|
|
|
|
unsigned status = 0;
|
|
|
|
g.on_error([&status](std::string, std::string, unsigned http_status) {
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.on_complete([&status](std::string /* body */, unsigned http_status){
|
|
|
|
status = http_status;
|
|
|
|
});
|
|
|
|
|
|
|
|
g.perform_sync();
|
|
|
|
|
|
|
|
REQUIRE(status == 200);
|
|
|
|
}
|
|
|
|
|