From 77761802f55adb907e64fabb73e337406d0aa37e Mon Sep 17 00:00:00 2001
From: Sami Al-Dury <57627858+samialdury@users.noreply.github.com>
Date: Fri, 25 Feb 2022 14:14:07 +0100
Subject: [PATCH] fix: recorder route

---
 src/proxy/handler.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/proxy/handler.ts b/src/proxy/handler.ts
index b1f5059..8bcc91a 100644
--- a/src/proxy/handler.ts
+++ b/src/proxy/handler.ts
@@ -27,7 +27,10 @@ export const handler = async (
 
 	for (const route of ROUTES) {
 		// Legacy routes, will be removed
-		if (req.url.startsWith('/record') || req.url.startsWith('/v2/record')) {
+		if (
+			req.url !== '/recorder.js' &&
+			(req.url.startsWith('/record') || req.url.startsWith('/v2/record'))
+		) {
 			const targetHost = config.get('proxy.hosts.webSdkWriter')
 			const url = `${targetHost}${req.url}`
 			await pipeResponse(targetHost, url, req, res)