-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use FnApiUrl.Path when getting server version (fnproject/fn#1339) #30
Use FnApiUrl.Path when getting server version (fnproject/fn#1339) #30
Conversation
This issue fixes a bug that was preventing the CLI (and any other libraries that use this) from finding the server version when the server was accessed using a non-root path. Fixes fnproject/fn#1339
thanks @vzDevelopment ! have you by chance tested the default when the url.Path is the empty string, does it still default to root correctly and work with the cli like normal? LGTM if both work, just double checking. |
Hi Reed, I'm not sure I fully understand - don't the last two test when the However, here's what happens when the API URL is set to the default (i.e. no path is set):
I was curious to see what would happen if I added a path of
And a test I did, but looks like I missed it from the PR, was testing a non-default path and port (here the server is running on
The proxy logs are as follows:
Here's a test where the API URL is set incorrectly:
|
Something to note, but is out of scope of this PR, is that the fn code will remove paths with a suffix of
Proxy logs:
Of course changing the v1 to something else does work:
Proxy logs
I feel this is very unlikely to occur and not something we need to worry about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Reed, I'm not sure I fully understand - don't the last two test when the url.Path is an empty string?
oops, sorry, I glossed over the last one. LGTM
Something to note, but is out of scope of this PR, is that the fn code will remove paths with a suffix of v1/.
good find. this is probably a relic, /v1 API isn't supported anymore either, so we can probably remove these hacks from the provider here since they're dead at this point
circleci seems messed up... looking into it, will get this merged though, thank you |
The v1 API is no longer supported so we can now remove this hack. C.f. the discussion on fnproject#30 and fnproject/fn#1347.
This issue fixes a bug that was preventing the CLI (and any other libraries that use this) from finding the server version when the server was accessed using a non-root path c.f. fnproject/fn#1339.
As you can see, before the change the server version is
?
when using a non-root path:This is because the cli was trying request
/version
as shown by the logs from the reverse proxy I was using:Once I made this change and recompiled the cli the output of the command is now as follows:
And the logs from the reverse proxy show it's correctly requesting
/fn/version
:The cli is also working when no
$FN_API_URL
is set:And it also works if I start the server on another port try with no path: