Skip to content

Commit

Permalink
feature: simplify html content type (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Dec 27, 2024
1 parent a9fe741 commit 5cf936d
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> => {
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,
Expand Down

0 comments on commit 5cf936d

Please sign in to comment.