mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 18:58:00 -06:00
Enable http digest authentication for CURL
This commit is contained in:
parent
c5b06dc1ff
commit
0a932ebfe3
5 changed files with 50 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "slic3r/Utils/Http.hpp"
|
||||
|
||||
TEST_CASE("Http", "[Http][NotWorking]") {
|
||||
TEST_CASE("Check SSL certificates paths", "[Http][NotWorking]") {
|
||||
|
||||
Slic3r::Http g = Slic3r::Http::get("https://github.com/");
|
||||
|
||||
|
@ -20,3 +20,41 @@ TEST_CASE("Http", "[Http][NotWorking]") {
|
|||
REQUIRE(status == 200);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue