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

Correctly initialize env and headers #1446

Merged
merged 2 commits into from
Jul 20, 2016

Conversation

leifg
Copy link
Contributor

@leifg leifg commented Jul 19, 2016

No description provided.


@request = Grape::Request.new(env)
@params = @request.params
@headers = @request.headers
Copy link
Member

Choose a reason for hiding this comment

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

I am merging this. But I wonder whether we can introduce a module/class/code that can be injected here and in other places where these properties would be memoized the first time we request them. Especially the construction of Grape::Request is not free as it parses the environment.

@dblock dblock merged commit 21925fc into ruby-grape:master Jul 20, 2016
@dblock
Copy link
Member

dblock commented Jul 20, 2016

Thanks much @leifg. Merged. See my comment in case we can improve this further.

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

Successfully merging this pull request may close these issues.

2 participants