Skip to content

Commit

Permalink
Move server FQDN to query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Dec 20, 2018
1 parent 2a94b15 commit 410015e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions services/matrix/matrix.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = class Matrix extends BaseJsonService {
}
}

async handle({ roomAlias, serverFQDN }) {
async handle({ roomAlias }, { serverFQDN }) {
const members = await this.fetch({ roomAlias, serverFQDN })
return this.constructor.render({ members })
}
Expand All @@ -183,8 +183,9 @@ module.exports = class Matrix extends BaseJsonService {
static get route() {
return {
base: 'matrix',
format: '([^/]+)(?:/([^/]+))?',
capture: ['roomAlias', 'serverFQDN'],
format: '([^/]+)',
capture: ['roomAlias'],
queryParams: ['serverFQDN'],
}
}

Expand Down
4 changes: 3 additions & 1 deletion services/matrix/matrix.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ t.create('server uses a custom port')
})

t.create('specify the homeserver fqdn')
.get('/ALIAS:DUMMY.dumb/matrix.DUMMY.dumb.json?style=_shields_test')
.get(
'/ALIAS:DUMMY.dumb.json?style=_shields_test&serverFQDN=matrix.DUMMY.dumb'
)
.intercept(nock =>
nock('https://matrix.DUMMY.dumb/')
.post('/_matrix/client/r0/register?kind=guest')
Expand Down

0 comments on commit 410015e

Please sign in to comment.