match exact hostname for same-origin discovery

This commit is contained in:
aj 2017-08-02 01:06:33 +00:00
parent 5163463dd2
commit 9c093ca3a1
1 changed files with 1 additions and 1 deletions

View File

@ -800,7 +800,7 @@
opts = opts || {};
providerUri = OAUTH3.url.normalize(providerUri);
if (providerUri.match(OAUTH3._browser.window.location.hostname)) {
if (OAUTH3.uri.normalize(providerUri).replace(/\/.*/, '') === OAUTH3.uri.normalize(OAUTH3._browser.window.location.hostname)) {
console.warn("It looks like you're a provider checking for your own directive,"
+ " so we we're just gonna use"
+ " OAUTH3.request({ method: 'GET', url: '.well-known/oauth3/directive.json' })");