class PeerTubePlugin extends Plugin {
private readonly videoViewUrl: string
- private readonly authorizationHeader: string
+ private readonly authorizationHeader: () => string
private readonly videoUUID: string
private readonly startTime: number
'Content-type': 'application/json; charset=UTF-8'
})
- if (this.authorizationHeader) headers.set('Authorization', this.authorizationHeader)
+ if (this.authorizationHeader) headers.set('Authorization', this.authorizationHeader())
return fetch(this.videoViewUrl, { method: 'POST', body: JSON.stringify(body), headers })
}