File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -61,3 +61,4 @@ export const CDN_MAX_AGE = process.env.CDN_MAX_AGE
6161 : 1000 * 60 * 60 ; // one hour
6262
6363export const ENDPOINT = USE_CLOUDFRONT ? CLOUDFRONT_ENDPOINT : S3_ENDPOINT ;
64+ export const HOSTNAME_OVERRIDE = process . env . HOSTNAME_OVERRIDE || "" ; // Useful for hosting via Docker
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Request } from "express";
22import Joi from "joi" ;
33import logger from "../services/log" ;
44import * as preSignedUrlService from "./service" ;
5+ import { HOSTNAME_OVERRIDE } from "../config/constants" ;
56
67function validatePresigningOptions ( req : Request ) : Joi . ValidationResult {
78 const uploadSchema = Joi . object ( {
@@ -26,7 +27,7 @@ export async function getPresignedUrl(
2627 userId : req . user . id ,
2728 apikey : req . apikey ,
2829 protocol : req . protocol ,
29- host : req . get ( "Host" ) ,
30+ host : HOSTNAME_OVERRIDE || req . get ( "Host" ) ,
3031 group : req . body . group ,
3132 } ) ;
3233 return res . status ( 200 ) . json ( { message : presignedUrl } ) ;
You can’t perform that action at this time.
0 commit comments