-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Curl module may accidentally reuse URL #601
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The URL from a previous call can accidentally be reused for later, misconfigured, call.
Reproduction:
Observed behaviour:
The second call uses the URL from the previous call.
Expected behaviour:
The second call should either:
url
is missing from the options, orThe error on missing URL could also be better... (Should this be another issue?)
I would expect either an explicit error from the library, or some error from curl itself. (Although I'm not sure if there is any meaningful case where curl could be used without the URL?)
However, now the error happens at
plenary.nvim/lua/plenary/curl.lua
Line 246 in a3e3bc8
parse.url(nil)
returns zero values.Cause:
The
spec
table is shared between all the methods and calls, but theurl
field is not always set. This can lead to unintentional reuse of the field.plenary.nvim/lua/plenary/curl.lua
Lines 325 to 335 in a3e3bc8
I could see some use case for this behaviour, but I think it should be an explicit API. (The
request
method is also inconsistent with the others and bit surprising how it may end up ignoring the first argument.)So, am I correct assuming this is a bug, not a feature?
The text was updated successfully, but these errors were encountered: