-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add handling for trailing slash in the KESTRA_URL configuration to avoid missing or double slash #6041
Comments
hey. The code implementation takes the URL specified in the configuration files (application-{env}.yml or any other way to provide the value) and concats the "/ui" + the rest of the path to that URL. This could be fixed in the code by removing the slash if specified or to tell users to specify the URL without the slash at the end. Here is the code creating the final URL:
where kestraUrl is fetched from configuration:
So, did you maybe specify in your application-local.yml or anywhere else the environment variable kestra.url as: "http://localhost:8084/"? @loicmathieu what do you think? |
Hey @anna-geller, Is there an internal decision to handle this case? If so, I’d be happy to take care of it. Also, @wrussell1999 could you confirm whether the / was added to the configuration somewhere? |
Hi @benjoEK1337, we would love to see your contribution. There are no internal discussions about this — in the end, we can't guarantee that the user adds a trailing slash in their configuration file so the code needs to:
WDYT? does it sound like a good plan to you? 🚀 |
I think that the expected behavior for the user is not to add the trailing slash. The current implementation doesn't expect the trailing slash, so if the user adds a trailing slash, the returned URL contains two trailing slashes. So, my suggestion for implementation is to check if the user added a trailing slash, and then remove it in the code. Regarding the case when KESTRA_URL is not set, the current logic is handling it this way:
So if no KESTRA URL is set, it doesn't include the KESTRA_URL in the returned URL. So should we change to not return the URL when the KESTRA_URL is not set, as you suggested, or keep this part of the logic as it is? |
The current behavior seems fine. Looking forward to your PR! Thanks for looking into this |
Hey @anna-geller, I created the PR. Could you please assign me to this task and add a reviewer to the PR? Thanks 🚀 |
Describe the issue
When I executed a flow using the API, I got a response with a URL to Kestra that contained two slashes when only one was needed.
Flow:
API Request made in the terminal:
Response given:
Specifically the bottom line
url
has two/
after the server URL. It should be:"url": "http://localhost:8084/ui/executions/company.team/hello_world/6gTABm82mx5li7tHkgqyNU"
Should be a quick fix, and doesn't stop it working - just a minor bug.
Environment
The text was updated successfully, but these errors were encountered: