-
Notifications
You must be signed in to change notification settings - Fork 120
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 support for duplicate keys in parameters by adding paramValuesAsSeq
#323
base: master
Are you sure you want to change the base?
Add support for duplicate keys in parameters by adding paramValuesAsSeq
#323
Conversation
…l test requirements are present Only do this when nim version < 2.0
…re running the tests
…Seq` In contrast to `params` this returns a `Table[string, seq[string]]`. Closes dom96#247
This is also the same implementation used in `paramValuesAsSeq` (except for the return type), this way we ensure the same behaviour for the parsing/decoding steps.
Currently the server throws a 'SIGSEGV: Illegal storage access. (Attempt to read from nil?)'
Access url field
My mistake - I was sure, that there were a Failing CI on nim v2This is when |
CInim v2Alright, thanks for the info. I guess the addition of this CI version can be done at a later point then. WindowsRegarding the CI on windows, the exact error message is (nim: 1.6.14)
I found the following issue in asynctools: cheatfate/asynctools#31 which seems to explain this. How do you want to proceed with this? Aside from these 2 issues, is there anything left which has to be addressed (additional reviews/changes/documentation/examples/...)? I guess at least the CI workflow still has to be approved and we need to test this on the mac pipeline (needs a decision on how the current windows bug should be handled). |
The For the I like the PR and your additional tests 👍. But, I'm just a contributor to the repo, so it must be @dom96 who can give you the directions for the next step. |
This reverts commit a4111d9.
Alright, thanks for your help. I've reverted the I'll wait for some input from dom then. |
Note about the Windows CI failures, I've fixed the I ran these on the current master to ensure that none of my changes has any impact on this. (I've ran mine as well and they're all The following test suites fail (I haven't looked into why this is):
Note that the I guess the impact from the Windows CI failing should be ignored in this case since it fails due to conditions which are already on master, this should probably be fixed separately. logs for
|
Closes #247
I've implemented an example solution (new function) so that we can discuss further based on this.
I've opened this as a PR since the actual implementation discussion is not really relevant for the issue itself.
I'm sorry to say that I'm still not entirely sure how the following would work:
I'm still fairly new to nim (<1000 lines) so forgive me if I'm missing something obvious here, the only options I see to implement this are
dotOperators
)url
property (new type?) toRequest
which supports this feature (this modifies code even further though and would be inconsistent with the current implementation)proc
to a different implementation when explicitely called by the user (or the library)httpbeast
and the standard library and expose this via jester (also needs code changes since theNativeRequest
isn't exposed to the user) (also unlikely to be accepted)That being said, this should probably be a separate function in any case which can be used by any of the other options if another shortcut/accessor is implemented for this.
I'm not entirely happy with the name (feel free to suggest others) but I hope it's at least clear enough on what it does.
I've removed the explicit call to
decodeUrl(value)
(in bothparams
andparamValuesAsSeq
) sincedecodeData
(decodeQuery
internally) does the decoding for us already.parseUrlQuery
I've also updated the
params
function to not useparseUrlQuery
anymore since this has been marked as deprecated in any case.With this change the 2 function operate essentially the same exact way (excluding the return type).
I haven't removed it since it's exported and might be used by users.
Tests
I've also implemented some tests for both
params
andparamValuesAsSeq
(exactly the same tests with different results).I tested this against the old version of
params
and the new version.CI
os
Currently the CI:
versions
CI succeeds for nim 1.4.8 and 1.6.14, for nim 2 the CI throws a
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
.I've observed this behaviour with jester before and either running nim with
--mm:refc
or importingstd/segfaults
fixed this (which is very frustrating).I've only tested running with
--mm:refc
which didn't fix it in the CI, I didn't want to importstd/segfaults
in all tests only for the CI to work since this is obviously a bug somewhere.I haven't looked into this any closer though, everything (tests + jester itself) run fine for me with nim 2.0 (locally and in docker).
Comments on things I've updated which aren't directly related to the issue. I hope including this here is fine with you, otherwise I don't mind pulling these changes out and opening a separate PR with them.
Exclude testing
tests/nim-in-action-code
fornim >= 2.0
nim-in-action-code isn't trying to be compatible with nim 2 (as far as I can tell).
The compilation currently fails because
db_sqlite
isn't available anymore (needs animble install db_connector
and a change of import, i.e. ->db_connector/db_sqlite
Update the CI
Basically this #319, I didn't want a broken CI when submitting a PR.
Update
nimble test
Up to now the user had to execute some steps themselves (e.g. refresh/install),
nimble test
should now work without any further input from the user after cloning the repository..gitignore
I've developed with intellij so I've added the common ignores for this IDEhas been reverted (see #323 (comment))