Skip to content

Commit

Permalink
hotfix: typescript validation error cause build failed(#4112)
Browse files Browse the repository at this point in the history
  • Loading branch information
biaoli0 authored Aug 24, 2022
1 parent 42c55b0 commit aef2d98
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/lesmis-server/src/routes/PDFExportRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { Request, Response, NextFunction } from 'express';
import { Route } from '@tupaia/server-boilerplate';
import { downloadPageAsPdf } from '@tupaia/tsutils';
import { convertToCDNHost } from '@tupaia/utils';

type Body = {
pdfPageUrl: string;
Expand All @@ -27,8 +26,7 @@ export class PDFExportRoute extends Route<PDFExportRequest> {

public async buildResponse() {
const { pdfPageUrl } = this.req.body;
const { cookie, host, via } = this.req.headers;
const cookieDomain = via && via.includes('cloudfront.net') ? convertToCDNHost(host) : host;
const { cookie, host: cookieDomain } = this.req.headers;

const buffer = await downloadPageAsPdf(pdfPageUrl, cookie, cookieDomain);
this.res.set({
Expand Down

0 comments on commit aef2d98

Please sign in to comment.