1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

Merge pull request #1 from nobodys-tools/patch-1

Patch 1
This commit is contained in:
nobody 2025-02-19 16:31:42 +01:00 committed by GitHub
commit 98ae8249ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -208,7 +208,10 @@ export function parseHeaders(headers: UploadHeaders, fileConfig: Config['files']
}
const returnDomain = headers['x-zipline-domain'];
if (returnDomain) response.overrides.returnDomain = returnDomain;
if (returnDomain) {
const domainArray = returnDomain.split(",");
response.overrides.returnDomain = domainArray[Math.floor(Math.random() * domainArray.length)].trim();
}
if (headers['content-range']) {
const [start, end, total] = headers['content-range']

View file

@ -62,7 +62,11 @@ export default fastifyPlugin(
);
let maxViews: number | undefined;
const returnDomain = req.headers['x-zipline-domain'];
let returnDomain = req.headers['x-zipline-domain'];
if (returnDomain) {
const domainArray = returnDomain.split(",");
returnDomain = domainArray[Math.floor(Math.random() * domainArray.length)].trim();
}
const maxViewsHeader = req.headers['x-zipline-max-views'];
if (maxViewsHeader) {