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

Adding extra data to request #118

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Conversation

gmgalvan
Copy link
Contributor

@gmgalvan gmgalvan commented Oct 26, 2020

Description

Make a clear and detailed description of your changes, with the added benefits.

Adding an extra data to Request that would allow middleware to process data that is not part of the request's body
Example a new middleware that could wrap extra information to teh Request and later be processed.

Possible drawbacks

None

Related issue(s)

List all related issues here:

Additional information

@coveralls
Copy link

coveralls commented Oct 26, 2020

Pull Request Test Coverage Report for Build 330423480

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0007%) to 98.786%

Totals Coverage Status
Change from base Build 328989724: 0.0007%
Covered Lines: 3661
Relevant Lines: 3706

💛 - Coveralls

@gmgalvan
Copy link
Contributor Author

Just I have a doubt about where to initialize it empty in order to avoid memory usage and if is needed an example in a build in middleware or new one.

@System-Glitch System-Glitch self-requested a review October 26, 2020 08:46
@System-Glitch System-Glitch self-assigned this Oct 26, 2020
@System-Glitch System-Glitch added the enhancement Enhancement of existing feature label Oct 26, 2020
Copy link
Member

@System-Glitch System-Glitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the map will be nil everywhere, you have to initialize it empty in router.go#requestHandler() and testsuite.go#CreateTestRequest().

A quick example in the documentation would be nice too.

@System-Glitch System-Glitch changed the base branch from master to develop October 26, 2020 10:31
@gmgalvan
Copy link
Contributor Author

I added one example about creating a new middleware and adding the extra information to the request, and I think I initialize empty in router.go#requestHandler() and testsuite.go#CreateTestRequest() the Extra property. mm do we need to update the branch? or something that am I missing?

@System-Glitch System-Glitch merged commit 6b1cfbe into go-goyave:develop Oct 27, 2020
@System-Glitch
Copy link
Member

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request extra-data or with context value
3 participants