Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improper redirected URL , in case of params #94

Open
Nazi-pikachu opened this issue Aug 27, 2023 · 3 comments · May be fixed by #95
Open

Improper redirected URL , in case of params #94

Nazi-pikachu opened this issue Aug 27, 2023 · 3 comments · May be fixed by #95

Comments

@Nazi-pikachu
Copy link
Collaborator

Nazi-pikachu commented Aug 27, 2023

Describe the bug
When the original url has params in it the current resolveRedirect method is redirected to incorrect URL.
For ex:-
original url : https://example.com/?k1=v1&k2=v2&k3=v3
params : {
expiry : 300
}
expected redirected url = https://example.com/?k1=v1&k2=v2&k3=v3&expiry=300
actual redirected url = https://example.com/?k1=v1&k2=v2&k3=v3?expiry=300

To Reproduce
Steps to reproduce the behavior:

  1. Create a shorten URL with original url having some query params
  2. Add some params like expiry
  3. Create the shorten URL
  4. See the the url getting redirected.

Expected behavior
Correct URL should be like : https://example.com/?k1=v1&k2=v2&k3=v3&expiry=300

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@Nazi-pikachu Nazi-pikachu linked a pull request Aug 27, 2023 that will close this issue
@yuvrajsab
Copy link
Member

@Nazi-pikachu, You can quickly fix this by checking if the URL already contains query parameters. if not, then add ?k=v, or if it already has them then append it to existing parameters &k=v if it already contains it.

@Nazi-pikachu
Copy link
Collaborator Author

@yuvrajsab
Sure i wil do this

@Apurv428
Copy link

@yuvrajsab If this issue is not fixed, can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants