Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Commit

Permalink
add domain= queryarg to the .well-known fetch
Browse files Browse the repository at this point in the history
This should allow multiple primaries to delegate control to the same
server, by letting the server know which domain we're interested in.
This is similar to how the HTTP "Host" header enables named-based
virtual hosting. Both the Verifier and the user agent (specifically the
/wsapi/address_info handler) will add this argument. Servers which host
only one key can ignore it.

Also allow arbitrary queryargs in bin/proxy, otherwise it denies
requests with queryargs.

This should help Bigtent do dynamic .well-known lookups.
  • Loading branch information
warner committed Oct 29, 2012
1 parent ca7ac3b commit 5cbb5ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/proxy
Expand Up @@ -19,7 +19,7 @@ var addy = config.has('bind_to.host') ? config.get('bind_to.host') : "127.0.0.1"
// set a maximum allowed time on responses to declaration of support requests
forward.setTimeout(config.get('declaration_of_support_timeout_ms'));

const allowed = /^https:\/\/[a-zA-Z0-9\.\-_]+\/\.well-known\/browserid$/;
const allowed = /^https:\/\/[a-zA-Z0-9\.\-_]+\/\.well-known\/browserid(\?.*)?$/;

var server = http.createServer(function (req, res) {
var url = req.url;
Expand Down
4 changes: 2 additions & 2 deletions lib/primary.js
Expand Up @@ -191,15 +191,15 @@ var getWellKnown = function (fromDomain, principalDomain, delegates, cb) {
req = http.get({
host: httpProxy.host,
port: httpProxy.port,
path: 'https://' + fromDomain + WELL_KNOWN_URL,
path: 'https://' + fromDomain + WELL_KNOWN_URL + "?domain=" + principalDomain,
headers: {
host: fromDomain
}
}, handleResponse);
} else {
req = https.get({
host: fromDomain,
path: WELL_KNOWN_URL,
path: WELL_KNOWN_URL + "?domain=" + principalDomain,
agent: false
}, handleResponse);
}
Expand Down

0 comments on commit 5cbb5ac

Please sign in to comment.