@@ -311,7 +311,7 @@ protected function getRequestBody(StreamInterface|array|string $body, RequestInt
311
311
/**
312
312
* Determine the request target from the given URI (path segment or URL) with respect to $apiURL,
313
313
* anything except host and path will be ignored, scheme will always be set to "https".
314
- * Throws if the given path is invalid or if the host of a given URL does not match $apiURL.
314
+ * Throws if the host of a given URL does not match the host of $apiURL.
315
315
*
316
316
* @see \chillerlan\OAuth\Core\OAuthInterface::request()
317
317
*
@@ -335,12 +335,8 @@ protected function getRequestTarget(string $uri):string{
335
335
336
336
// for some reason we were given a host name
337
337
338
- if ($ parsedURL ->getScheme () !== 'https ' ){
339
- throw new ProviderException (sprintf ('scheme of the URL (%s) must be "https" if host is given ' , $ parsedURL ));
340
- }
341
-
342
- // we explicitly ignore any existing parameters here
343
- $ parsedURL = $ parsedURL ->withQuery ('' )->withFragment ('' );
338
+ // we explicitly ignore any existing parameters here and enforce https
339
+ $ parsedURL = $ parsedURL ->withScheme ('https ' )->withQuery ('' )->withFragment ('' );
344
340
$ apiHost = $ api ->getHost ();
345
341
346
342
if ($ parsedHost === $ apiHost ){
@@ -362,7 +358,6 @@ protected function getRequestTarget(string $uri):string{
362
358
return (string )$ parsedURL ;
363
359
}
364
360
365
- // back out if it doesn't match
366
361
throw new ProviderException (sprintf ('given host (%s) does not match provider (%s) ' , $ parsedHost , $ apiHost ));
367
362
}
368
363
0 commit comments