Skip to content

Commit 664cce7

Browse files
authored
fix: included query params in redirecting to prefix 0x in tx endpoint (#1205)
1 parent fcc7025 commit 664cce7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/routes/tx.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ export function createTxRouter(db: PgStore): express.Router {
240240
asyncHandler(async (req, res, next) => {
241241
const { tx_id } = req.params;
242242
if (!has0xPrefix(tx_id)) {
243-
return res.redirect('/extended/v1/tx/0x' + tx_id);
243+
const baseURL = req.protocol + '://' + req.headers.host + '/';
244+
const url = new URL(req.url, baseURL);
245+
return res.redirect('/extended/v1/tx/0x' + tx_id + url.search);
244246
}
245247

246248
const eventLimit = parseTxQueryEventsLimit(req.query['event_limit'] ?? 96);

0 commit comments

Comments
 (0)