Fix firstHostSegment logic

This commit is contained in:
Matt Bierner 2021-05-21 12:51:22 -07:00
parent 827dec3a0d
commit 06a86116b7
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -254,7 +254,7 @@ async function processResourceRequest(event, requestUrl) {
const { requestId, promise } = resourceRequestStore.create();
const firstHostSegment = requestUrl.hostname.slice(0, resourceBaseAuthority.length);
const firstHostSegment = requestUrl.hostname.slice(0, requestUrl.hostname.length - (resourceBaseAuthority.length + 1));
const scheme = firstHostSegment.split('+', 1)[0];
const authority = firstHostSegment.slice(scheme.length + 1); // may be empty