Skip to content

Commit

Permalink
Merge pull request #4788 from remotion-dev/use-new-url
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger authored Jan 23, 2025
2 parents 7c5ade2 + 449893f commit f3820bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/renderer/src/serve-handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {Stats} from 'node:fs';
import {createReadStream, promises} from 'node:fs';
import type {IncomingMessage, ServerResponse} from 'node:http';
import path from 'node:path';
import url from 'node:url';
import {mimeContentType} from '../mime-types';
// Packages
import {isPathInside} from './is-path-inside';
Expand Down Expand Up @@ -112,9 +111,11 @@ export const serveHandler = async (
let relativePath = null;

try {
relativePath = decodeURIComponent(
url.parse(request.url as string).pathname as string,
const parsedUrl = new URL(
request.url as string,
`http://${request.headers.host}`,
);
relativePath = decodeURIComponent(parsedUrl.pathname);
} catch {
return sendError('/', response, {
statusCode: 400,
Expand Down

0 comments on commit f3820bd

Please sign in to comment.