From 5cf936d8b03a54393bd9d10bd54b202a06a68856 Mon Sep 17 00:00:00 2001 From: Le Vivilet <72156503+levivilet@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:01:04 +0100 Subject: [PATCH] feature: simplify html content type (#277) --- .../src/parts/HandleIndexHtml/HandleIndexHtml.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/preview-process/src/parts/HandleIndexHtml/HandleIndexHtml.ts b/packages/preview-process/src/parts/HandleIndexHtml/HandleIndexHtml.ts index 96e1ed6e..93c69e75 100644 --- a/packages/preview-process/src/parts/HandleIndexHtml/HandleIndexHtml.ts +++ b/packages/preview-process/src/parts/HandleIndexHtml/HandleIndexHtml.ts @@ -5,15 +5,12 @@ import * as CrossOriginResourcePolicy from '../CrossOriginResourcePolicy/CrossOr import * as GetContentSecurityPolicyDocument from '../GetContentSecurityPolicyDocument/GetContentSecurityPolicyDocument.ts' import * as GetContentType from '../GetContentType/GetContentType.ts' import * as HttpHeader from '../HttpHeader/HttpHeader.ts' -import * as ResolveFilePath from '../ResolveFilePath/ResolveFilePath.ts' import { NotFoundResponse } from '../Responses/NotFoundResponse.ts' export const handleIndexHtml = async (request: RequestOptions, options: HandlerOptions): Promise => { - const filePath = ResolveFilePath.resolveFilePath(request.path, options.webViewRoot) - try { const csp = GetContentSecurityPolicyDocument.getContentSecurityPolicyDocument(options.contentSecurityPolicy) - const contentType = GetContentType.getContentType(filePath) + const contentType = GetContentType.getContentType('/test/index.html') const headers = { [HttpHeader.CrossOriginResourcePolicy]: CrossOriginResourcePolicy.CrossOrigin, [HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,