stream: { write: logger.info }
}))
// For body requests
-app.use(bodyParser.json({ limit: '500kb' }))
+app.use(bodyParser.json({
+ type: 'application/*+json',
+ limit: '500kb'
+}))
app.use(bodyParser.urlencoded({ extended: false }))
// ----------- Tracker -----------
links: [
{
rel: 'self',
+ type: 'application/activity+json',
href: account.url
}
]
const SERVER_ACCOUNT_NAME = 'peertube'
const ACTIVITY_PUB = {
- ACCEPT_HEADER: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
+ ACCEPT_HEADERS: [
+ 'application/activity+json, application/ld+json',
+ 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
+ ],
+ ACCEPT_HEADER: '',
PUBLIC: 'https://www.w3.org/ns/activitystreams#Public',
COLLECTION_ITEMS_PER_PAGE: 10,
FETCH_PAGE_LIMIT: 100,
MAGNET: [ 'application/x-bittorrent;x-scheme-handler/magnet' ]
}
}
+ACTIVITY_PUB.ACCEPT_HEADER = ACTIVITY_PUB.ACCEPT_HEADERS[0]
// ---------------------------------------------------------------------------
operatorsAliases: false,
logging: (message: string, benchmark: number) => {
+ if (process.env.NODE_DB_LOG === 'false') return
+
let newMessage = message
if (isTestInstance() === true && benchmark !== undefined) {
newMessage += ' | ' + benchmark + 'ms'
function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
return (req: Request, res: Response, next: NextFunction) => {
- if (req.header('Accept') !== ACTIVITY_PUB.ACCEPT_HEADER) {
+ if (ACTIVITY_PUB.ACCEPT_HEADERS.indexOf(req.header('Accept')) === -1) {
return next()
}
+ logger.debug('ActivityPub request for %s.', req.url)
+
if (Array.isArray(fun) === true) {
return eachSeries(fun as RequestHandler[], (f, cb) => {
f(req, res, cb)
})
}
+ // Add video url too
+ url.push({
+ type: 'Link',
+ mimeType: 'text/html',
+ url: CONFIG.WEBSERVER.URL + '/videos/watch/' + this.uuid
+ })
+
const videoObject: VideoTorrentObject = {
type: 'Video' as 'Video',
id: this.url,
inherits "=2.0.1"
lodash "=3.10.1"
-"bitcore-message@github:comakery/bitcore-message#dist":
+"bitcore-message@github:CoMakery/bitcore-message#dist":
version "1.0.2"
- resolved "https://codeload.github.com/comakery/bitcore-message/tar.gz/8799cc327029c3d34fc725f05b2cf981363f6ebf"
+ resolved "https://codeload.github.com/CoMakery/bitcore-message/tar.gz/8799cc327029c3d34fc725f05b2cf981363f6ebf"
dependencies:
bitcore-lib "^0.13.7"