From 6f4ef3ca035f70818193807b2d51abe3627c687c Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Wed, 8 Dec 2021 16:53:06 -0800 Subject: [PATCH] Adding support for IPv6. --- src/framework/API_Proxy.h | 10 +++++++--- test_scripts/curl/cli | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/framework/API_Proxy.h b/src/framework/API_Proxy.h index 5890f95..b9ec6c5 100644 --- a/src/framework/API_Proxy.h +++ b/src/framework/API_Proxy.h @@ -21,7 +21,9 @@ namespace OpenWifi { Poco::URI DestinationURI(Svc.PrivateEndPoint); DestinationURI.setPath(PathRewrite); DestinationURI.setQuery(SourceURI.getQuery()); - std::cout << Request->getMethod() << " " << DestinationURI.getHost() << ":" << DestinationURI.getPort() << DestinationURI.getPathAndQuery() << std::endl; + + std::cout << " Source: " << SourceURI.toString() << std::endl; + std::cout << "Destination: " << DestinationURI.toString() << std::endl; Poco::Net::HTTPSClientSession Session(DestinationURI.getHost(), DestinationURI.getPort()); Session.setKeepAlive(true); @@ -50,8 +52,10 @@ namespace OpenWifi { auto Body = P.parse(Request->stream()).extract(); Poco::JSON::Stringifier::condense(Body,SS); SS << "\r\n\r\n"; - } catch(...) { - + } catch(const Poco::Exception &E) { + std::cout << "E: " << E.name() << std::endl; + std::cout << "E: " << E.message() << std::endl; + std::cout << "E: " << E.what() << std::endl; } std::cout << ">>>" << SS.str() << std::endl; diff --git a/test_scripts/curl/cli b/test_scripts/curl/cli index c0a341b..17ef69d 100755 --- a/test_scripts/curl/cli +++ b/test_scripts/curl/cli @@ -90,6 +90,7 @@ logout() { startmfa() { payload="{ \"type\" : \"sms\" , \"sms\" : \"$1\" }" + echo ${payload} curl ${FLAGS} -X PUT "https://${target_service_endpoint}/api/v1/submfa?startValidation=true" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${token}" \