diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-19 14:21:14 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-19 14:21:14 +0100 |
commit | 0405ab52dc0f445b88f8de76e30d6e6719196023 (patch) | |
tree | 85bb741791296ba1ede1efccd8d22f9f71169dc7 /server/middlewares/validators/webfinger.ts | |
parent | d4c6a3b985ea56f730d11fb1c5f04a4fdc86e4dc (diff) | |
download | PeerTube-0405ab52dc0f445b88f8de76e30d6e6719196023.tar.gz PeerTube-0405ab52dc0f445b88f8de76e30d6e6719196023.tar.zst PeerTube-0405ab52dc0f445b88f8de76e30d6e6719196023.zip |
Set port if not specified in webfinger
Diffstat (limited to 'server/middlewares/validators/webfinger.ts')
-rw-r--r-- | server/middlewares/validators/webfinger.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/validators/webfinger.ts b/server/middlewares/validators/webfinger.ts index 2c8351799..894c72498 100644 --- a/server/middlewares/validators/webfinger.ts +++ b/server/middlewares/validators/webfinger.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { query } from 'express-validator/check' | 2 | import { query } from 'express-validator/check' |
3 | import { logger } from '../../helpers' | 3 | import { getHostWithPort, logger } from '../../helpers' |
4 | import { isWebfingerResourceValid } from '../../helpers/custom-validators/webfinger' | 4 | import { isWebfingerResourceValid } from '../../helpers/custom-validators/webfinger' |
5 | import { ActorModel } from '../../models/activitypub/actor' | 5 | import { ActorModel } from '../../models/activitypub/actor' |
6 | import { areValidationErrors } from './utils' | 6 | import { areValidationErrors } from './utils' |
@@ -14,7 +14,7 @@ const webfingerValidator = [ | |||
14 | if (areValidationErrors(req, res)) return | 14 | if (areValidationErrors(req, res)) return |
15 | 15 | ||
16 | // Remove 'acct:' from the beginning of the string | 16 | // Remove 'acct:' from the beginning of the string |
17 | const nameWithHost = req.query.resource.substr(5) | 17 | const nameWithHost = getHostWithPort(req.query.resource.substr(5)) |
18 | const [ name ] = nameWithHost.split('@') | 18 | const [ name ] = nameWithHost.split('@') |
19 | 19 | ||
20 | const actor = await ActorModel.loadLocalByName(name) | 20 | const actor = await ActorModel.loadLocalByName(name) |