-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Found Bug 🐛: Auth and Cached decorators not working with Mounts #383
Labels
bug
Something isn't working
Comments
Merged
Ethosa
added a commit
that referenced
this issue
Dec 18, 2024
@Beetroit can you provide some example of code? |
Ethosa
added a commit
that referenced
this issue
Dec 18, 2024
since a8740fb this works fine: mount Profile:
@AuthJWT
@RateLimit
get "/":
## Profile main page
return "Hello, world!"
@RateLimit(perSecond = 5)
get "/rate-limit-test":
## Profile settings
# echo rateLimits[key]
return "Hello, world"
get "/cached-test":
## Profile settings
return "Hello, world"
serve "127.0.0.1", 5000:
@Cached(10)
mount "/profile" -> Profile And this also works fine: mount Profile:
@Cached(10)
get "/cached-test":
## Profile settings
return "Hello, world"
serve "127.0.0.1", 5000:
mount "/profile" -> Profile |
main.nim file
test_case.nim file
nim.cfg
EDIT: The errors comes up when the cached decorator is used on a route that's returning json, but not for plaintext. |
does it works with |
nope |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug 🐛
I use a mount in my api, the code is defined in another file and then mounted. When i try to use either of the new auth decorators, or the new cached one, i get a weird error. It happens whether i'm using the decorator in the mount but not from the main server file.
To Reproduce 👨🔬
Steps to reproduce the behavior:
Expected behavior 🤔
Mounts should work fine with the new decorators.
Screenshots 🖼
This is from the mount file.
Please complete the following information 📃
The text was updated successfully, but these errors were encountered: