[GH-ISSUE #4769] [bug]: unable to send a request containing slashes #1787

Closed
opened 2026-03-16 21:44:48 +03:00 by kerem · 3 comments
Owner

Originally created by @keliansb on GitHub (Feb 20, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4769

Originally assigned to: @xTudoS on GitHub.

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

I'm trying to get a file from a GitLab repository using the REST API, here is the documentation of the endpoint.

We can see that the file_path in the URL needs to be URL encoded.

Here is a request to get the file README.md at the root of this repository (so file_path is just README.md):

Image

And here is another request to get the file README.md in the folder changelogs (now file_path is changelogs%2FREADME.md):

Image

A 404 Not Found is returned because %2F has been replaced by a slash in the URL.

I tried on Hoppscotch cloud and self-hosted, both returned the same behavior.

Steps to reproduce

Import the following curl request into Hoppscotch:

curl --request GET --url 'https://gitlab.com/api/v4/projects/278964/repository/files/changelogs%2FREADME.md?ref=master

%2F is replaced by / in the URL when importing, so change the URL from changelogs/README.md to changelogs%2FREADME.md and then send the request

Environment

Production

Version

Cloud

Originally created by @keliansb on GitHub (Feb 20, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4769 Originally assigned to: @xTudoS on GitHub. ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current behavior I'm trying to get a file from a GitLab repository using the REST API, [here is](https://docs.gitlab.com/api/repository_files/#get-file-from-repository) the documentation of the endpoint. We can see that the `file_path` in the URL needs to be URL encoded. Here is a request to get the file `README.md` at the root of [this repository](https://gitlab.com/gitlab-org/gitlab) (so `file_path` is just `README.md`): ![Image](https://github.com/user-attachments/assets/4a7d4d2b-3088-44bd-9dc3-8aca430395c7) And here is another request to get the file `README.md` in the folder `changelogs` (now `file_path` is `changelogs%2FREADME.md`): ![Image](https://github.com/user-attachments/assets/ea36fff4-1a4e-4713-99e5-1831fc148a9d) A 404 Not Found is returned because `%2F` has been replaced by a slash in the URL. I tried on Hoppscotch cloud and self-hosted, both returned the same behavior. ### Steps to reproduce Import the following `curl` request into Hoppscotch: ``` curl --request GET --url 'https://gitlab.com/api/v4/projects/278964/repository/files/changelogs%2FREADME.md?ref=master ``` `%2F` is replaced by `/` in the URL when importing, so change the URL from `changelogs/README.md` to `changelogs%2FREADME.md` and then send the request ### Environment Production ### Version Cloud
kerem 2026-03-16 21:44:48 +03:00
Author
Owner

@xTudoS commented on GitHub (Feb 27, 2025):

I did some tests and find out where is the problem. Is in the function that imports curl command, more specific in this line:

const urlString = decodeURIComponent(concatParams(urlObject, danglingParams))

I removed the decodeURIComponent and it worked!

I will open a PR to request this change

<!-- gh-comment-id:2688541005 --> @xTudoS commented on GitHub (Feb 27, 2025): I did some tests and find out where is the problem. Is in the function that imports curl command, more specific in this line: `const urlString = decodeURIComponent(concatParams(urlObject, danglingParams))` I removed the decodeURIComponent and it worked! I will open a PR to request this change
Author
Owner

@xTudoS commented on GitHub (Feb 27, 2025):

about the code generation, is a issue in https://github.com/hoppscotch/httpsnippet/

<!-- gh-comment-id:2688567521 --> @xTudoS commented on GitHub (Feb 27, 2025): about the code generation, is a issue in https://github.com/hoppscotch/httpsnippet/
Author
Owner

@liyasthomas commented on GitHub (Jul 30, 2025):

This issue has been resolved in the latest version.

<!-- gh-comment-id:3136229862 --> @liyasthomas commented on GitHub (Jul 30, 2025): This issue has been resolved in the latest version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1787
No description provided.