Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🤗 [Question]: Is there any way to avoid parsing URLEncoded on Agent? #3096

Open
3 tasks done
luiz-otavio opened this issue Aug 3, 2024 · 1 comment
Open
3 tasks done

Comments

@luiz-otavio
Copy link

Question Description

I've to make some requests to a specific host with an URL encoded through the params, such as:
https://example.my.host/other.host%2path%2to%2data%31231231

But instead, it parses to:
https://example.my.host/other.host/path/to/data/31231231

I tried using DisablePathNormalizing from my agent, but it didn't work and seems like it doesn't apply any effect on the method Parse from FastHttp.

Code Snippet (optional)

package main

import "github.com/gofiber/fiber/v3"
import "log"

func main() {
    agent := fiber.Get(fmt.Sprintf("https://example.my.host/%s", url.QueryEncode("other.host/path/to/data/31231231")))

    // If you tries to debug it, it'll show like 
    // https://example.my.host/other.host%2path%2to%2data%231231231
 
    agent.DisablePathNormalizing = true
    agent.Set("Content-Type", "application/json")

    // It parses to https://example.my.host/other.host/path/to/data/31231231
    slog.Info("URL: ", agent.Request().URI().String())
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.
Copy link

welcome bot commented Aug 3, 2024

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant