From 61c549189cb85fb1e94e9571da360dad98c25a06 Mon Sep 17 00:00:00 2001 From: Jonathan Daggerhart Date: Wed, 19 Apr 2017 15:11:11 -0400 Subject: [PATCH] adding port to the request headers per issue #30 --- includes/openid-connect-generic-client.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/openid-connect-generic-client.php b/includes/openid-connect-generic-client.php index 53e3517..4f306a1 100644 --- a/includes/openid-connect-generic-client.php +++ b/includes/openid-connect-generic-client.php @@ -207,6 +207,11 @@ class OpenID_Connect_Generic_Client { // Add Host header - required for when the openid-connect endpoint is behind a reverse-proxy $parsed_url = parse_url($this->endpoint_userinfo); $host = $parsed_url['host']; + + if ( !empty( $parsed_url['port'] ) ) { + $host.= ":{$parsed_url['port']}"; + } + $request['headers']['Host'] = $host; // attempt the request including the access token in the query string for backwards compatibility