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

Uses URL constructor to reliably generate the url #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

msjonker
Copy link

@msjonker msjonker commented Jun 5, 2020

This fixes the form submit URL when the request is not to the root path. Using the lastIndexOf "/" will get the last directory, but it always needs to be the root. So, for example, if the page being attempted is https://bouqs.com/flowers/all and the action is /flowers/all, the existing code would generate https://bouqs.com/flowers/flowers/all. The URL constructor can intelligently generate the URL from a given base: https://nodejs.org/api/url.html#url_constructor_new_url_input_base

@msjonker msjonker mentioned this pull request Jan 5, 2021
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 this pull request may close these issues.

None yet

1 participant