forwardemail / forwardemail/superagent

[fix] .. in path gets collapsed after 9.0.2

Open
#1,816 3 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## 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
```js
require("superagent").get("http://localhost:3000/api/v2/../error").then(console.log, console.error)
```

## Checklist

- [x] I have searched through GitHub issues for similar issues.
- [ ] I have completely read through the README and documentation.
- [ ] I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Node.js reproduction against superagent 9.0.2 and compare the requested path with the path received by the local server. Trace where URL paths are canonicalized, then verify that `/api/v2/../error` is preserved as expected without regressing other URL handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.