aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-10 08:51:58 +0200
committerChocobozzz <me@florianbigard.com>2018-10-10 08:51:58 +0200
commit729bb184819ddda1d7313da0c30b3397e5689721 (patch)
treed14993d6fde02ae4eac0ff9378f6d278a5e03bd4 /server/helpers
parent6321cbc3e7a43257b03b3285ab69b7977fd7f616 (diff)
downloadPeerTube-729bb184819ddda1d7313da0c30b3397e5689721.tar.gz
PeerTube-729bb184819ddda1d7313da0c30b3397e5689721.tar.zst
PeerTube-729bb184819ddda1d7313da0c30b3397e5689721.zip
Add more headers to broadcast/unicast
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/core-utils.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts
index 00bc0bdda..224e4fe92 100644
--- a/server/helpers/core-utils.ts
+++ b/server/helpers/core-utils.ts
@@ -5,7 +5,7 @@
5 5
6import * as bcrypt from 'bcrypt' 6import * as bcrypt from 'bcrypt'
7import * as createTorrent from 'create-torrent' 7import * as createTorrent from 'create-torrent'
8import { createHash, pseudoRandomBytes } from 'crypto' 8import { createHash, HexBase64Latin1Encoding, pseudoRandomBytes } from 'crypto'
9import { isAbsolute, join } from 'path' 9import { isAbsolute, join } from 'path'
10import * as pem from 'pem' 10import * as pem from 'pem'
11import { URL } from 'url' 11import { URL } from 'url'
@@ -126,8 +126,8 @@ function peertubeTruncate (str: string, maxLength: number) {
126 return truncate(str, options) 126 return truncate(str, options)
127} 127}
128 128
129function sha256 (str: string) { 129function sha256 (str: string, encoding: HexBase64Latin1Encoding = 'hex') {
130 return createHash('sha256').update(str).digest('hex') 130 return createHash('sha256').update(str).digest(encoding)
131} 131}
132 132
133function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> { 133function promisify0<A> (func: (cb: (err: any, result: A) => void) => void): () => Promise<A> {