Skip to content
Snippets Groups Projects
Unverified Commit 3feaf392 authored by Mary's avatar Mary Committed by GitHub
Browse files

ApRequestService: don't generate our own Host header (#9378)

parent fe98ad88
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ export class ApRequestService {
method: 'POST',
headers: this.objectAssignWithLcKey({
'Date': new Date().toUTCString(),
'Host': u.hostname,
'Host': u.host,
'Content-Type': 'application/activity+json',
'Digest': digestHeader,
}, args.additionalHeaders),
......@@ -83,7 +83,7 @@ export class ApRequestService {
headers: this.objectAssignWithLcKey({
'Accept': 'application/activity+json, application/ld+json',
'Date': new Date().toUTCString(),
'Host': new URL(args.url).hostname,
'Host': new URL(args.url).host,
}, args.additionalHeaders),
};
......@@ -106,6 +106,8 @@ export class ApRequestService {
request.headers = this.objectAssignWithLcKey(request.headers, {
Signature: signatureHeader,
});
// node-fetch will generate this for us. if we keep 'Host', it won't change with redirects!
delete request.headers['host'];
return {
request,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment