Description
-
Description
I am encountering an issue where a simple GET request with automatic redirection works perfectly fine when run using the
terminal curl command, but it results in an infinite redirect loop and eventually returns a 414 Request-URI Too Long error when
using node-libcurl. -
Steps to Reproduce:
2.1 Here is the basic setup:
2.2 Terminal curl Request: When running the following command in the terminal:
bash
curl -X GET -I -L --insecure https://XXXXXX...
The request works as expected, follows the redirects, and returns a 200 OK status after resolving the redirect.
2.3 Now the behaviour from node-libcurl
Initial URL: https://XXXXXX...
302 Redirect to: https://XXXXXX.../login?ReturnUrl=%2F
302 Redirect to: https://XXXXXX.../login?ReturnUrl=%252F
302 Redirect to: https://XXXXXX.../login?ReturnUrl=%25252F -
Key Observations:
The same URL works when using terminal curl with the -L option (follow redirects) and --insecure.
The issue seems to be caused by improper handling of percent-encoded characters during the redirection process.
The repeated percent-encoding during each redirect is likely causing the infinite loop and the 414 error.Environment:
Node.js Version: 20.17.0
node-libcurl Version: 4.0.0
Operating System: Linux -
Additional Information:
It seems that terminal curl correctly handles the percent-encoding when following redirects, while node-libcurl is not. This behavior
is unexpected and leads to infinite redirects that result in a 414 error.
I would appreciate any insights or advice on how to resolve this issue or if there are specific configurations in node-libcurl that I might be missing.