mirror of
https://github.com/diced/zipline.git
synced 2025-04-11 23:31:17 -05:00
commit
98ae8249ff
2 changed files with 9 additions and 2 deletions
|
@ -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']
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue