aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-10 11:17:20 +0100
committerChocobozzz <me@florianbigard.com>2021-03-24 18:18:40 +0100
commite7053b1d9d7f77d0375155b38d3e845f2163ecd8 (patch)
treeb52375913c9b0352f5c765c40122cbbbc54bad13 /server/helpers
parent266131e0ca2f2622bbb15299212f00b1efa36867 (diff)
downloadPeerTube-e7053b1d9d7f77d0375155b38d3e845f2163ecd8.tar.gz
PeerTube-e7053b1d9d7f77d0375155b38d3e845f2163ecd8.tar.zst
PeerTube-e7053b1d9d7f77d0375155b38d3e845f2163ecd8.zip
Fix AP security tests
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/requests.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index 5eb69486d..fd2a56f30 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -170,9 +170,11 @@ function buildGotOptions (options: PeerTubeRequestOptions) {
170 170
171 let headers = options.headers || {} 171 let headers = options.headers || {}
172 172
173 headers = { ...headers, date: new Date().toUTCString() } 173 if (!headers.date) {
174 headers = { ...headers, date: new Date().toUTCString() }
175 }
174 176
175 if (activityPub) { 177 if (activityPub && !headers.accept) {
176 headers = { ...headers, accept: ACTIVITY_PUB.ACCEPT_HEADER } 178 headers = { ...headers, accept: ACTIVITY_PUB.ACCEPT_HEADER }
177 } 179 }
178 180