ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.59k stars 1.33k forks source link

[fix] .. in path gets collapsed after 9.0.2 #1816

Open vpzomtrrfrt opened 2 months ago

vpzomtrrfrt commented 2 months ago

Describe the bug

Node.js version: 20.15.1

OS version: Gentoo Linux rolling

Description: superagent started attempting to canonicalize URL paths in 9.0.2

Actual behavior

.. in paths gets interpreted by superagent, e.g. /api/v2/../error gets sent as /api/error.

Expected behavior

Paths should be sent as-is, or at least this should have waited for a major release

Code to reproduce

require("superagent").get("http://localhost:3000/api/v2/../error").then(console.log, console.error)

Checklist

vpzomtrrfrt commented 2 months ago

Bisecting shows 7e20ced59db3f8289276ffef168145f9aec9ba23 as breaking this

titanism commented 2 months ago

PR welcome