Skip to content
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

Cookie parser #2656

Merged
merged 9 commits into from
Oct 12, 2023
Merged

Cookie parser #2656

merged 9 commits into from
Oct 12, 2023

Conversation

joey1123455
Copy link
Contributor

Description

Implemented a cookie parser, following the same convention used by BodyParser and QuerryParser context methods.
The parser is a context method which takes a struct pointer as argument and assigns all passed cookies to the relevant fields. It returns an error if any.

The feature was requested as an issue, and provides an easier way to handle multiple cookies, and improves developer experience and development time.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • For new functionalities I follow the inspiration of the express js framework and built them similar in usage
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible)
  • I tried to make my code as fast as possible with as few allocations as possible
  • For new code I have written benchmarks so that they can be analyzed and improved

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@welcome
Copy link

welcome bot commented Oct 5, 2023

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@joey1123455
Copy link
Contributor Author

the issue for this pull request is
🚀 [Feature]: CookieParser #2639
#2639 (comment)

@ReneWerner87 ReneWerner87 linked an issue Oct 5, 2023 that may be closed by this pull request
3 tasks
@joey1123455
Copy link
Contributor Author

@ReneWerner87 Hello, I would like to know what needs to be done before a PR is approved.

@ReneWerner87
Copy link
Member

Currently everything we need is there
However, we are still discussing internally and since it is vacation time it is currently a bit slower

@joey1123455
Copy link
Contributor Author

@ReneWerner87 hello Rene, I noticed some checks failed. Is there anything I need to do?

@ReneWerner87
Copy link
Member

Yes, pls check the lint errors

@ReneWerner87
Copy link
Member

image

@joey1123455
Copy link
Contributor Author

joey1123455 commented Oct 11, 2023 via email

@joey1123455
Copy link
Contributor Author

Sorry for disturbing you, but I'm trying to confirm the last error I just need to add a test for the returned value? @ReneWerner87

@ReneWerner87
Copy link
Member

ReneWerner87 commented Oct 12, 2023

Sorry for disturbing you, but I'm trying to confirm the last error I just need to add a test for the returned value? @ReneWerner87

yes should be
but would recommend you to watch the binary locally via act or direct

https://github.com/nektos/act

act -W ./.github/workflows/linter.yml

@joey1123455
Copy link
Contributor Author

Sorry for disturbing you, but I'm trying to confirm the last error I just need to add a test for the returned value? @ReneWerner87

yes should be but would recommend you to watch the binary locally via act or direct

https://github.com/nektos/act

act -W ./.github/workflows/linter.yml

code
this is the test i wrote for it and i have other tests for the return value as well
code3
code1

@ReneWerner87
Copy link
Member

image

@ReneWerner87
Copy link
Member

ReneWerner87 commented Oct 12, 2023

bb026a6 fixed
image

@ReneWerner87 ReneWerner87 merged commit e70b2e2 into gofiber:master Oct 12, 2023
20 checks passed
@welcome
Copy link

welcome bot commented Oct 12, 2023

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 [Feature]: CookieParser
2 participants