From ec791cd5a20757dbdb7b813aa273bf9b434131f8 Mon Sep 17 00:00:00 2001 From: Le Thanh An Date: Wed, 24 Apr 2024 16:48:37 +0800 Subject: [PATCH] fix: fix URL decoding --- lib/server/createRecordingServer.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/server/createRecordingServer.js b/lib/server/createRecordingServer.js index c477452..cde131b 100644 --- a/lib/server/createRecordingServer.js +++ b/lib/server/createRecordingServer.js @@ -45,7 +45,8 @@ const createRecordingServer = async (config) => { res.status(response.status || 500); res.json(response.data); - const filename = getRecordingFileName(method, url); + const escapedUrl = url.replaceAll('%5B%5D', '[]'); + const filename = getRecordingFileName(method, escapedUrl); utils.saveRecording(_directory, filename, req, response); }); diff --git a/package.json b/package.json index da281ed..b325a19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-playback-server", - "version": "2.0.2", + "version": "2.0.3", "description": "", "main": "dist/index.js", "scripts": {