Skip to content

Commit

Permalink
fix(daf-express): Fix behavior of CLI HTTPS server behind proxy (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 9, 2020
1 parent 247141f commit 3c39484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/daf-express/src/api-schema-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ApiSchemaRouter = (options: ApiSchemaRouterOptions): Router => {
router.get('/', (req: RequestWithAgent, res) => {
if (req.agent) {
const openApiSchema = getOpenApiSchema(req.agent, '', options.exposedMethods)
const url = req.protocol + '://' + req.hostname + options.basePath
const url = (req.headers['x-forwarded-proto'] || req.protocol) + '://' + req.hostname + options.basePath
openApiSchema.servers = [{ url }]

if (options.securityScheme && openApiSchema.components) {
Expand Down

0 comments on commit 3c39484

Please sign in to comment.