Skip to content

Align implementation with Rack SPEC #1956

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

Merged
merged 5 commits into from
Jan 8, 2020
Merged

Align implementation with Rack SPEC #1956

merged 5 commits into from
Jan 8, 2020

Conversation

ioquatix
Copy link
Contributor

@ioquatix ioquatix commented Jan 8, 2020

And update specs/expand testing.

@grape-bot
Copy link

grape-bot commented Jan 8, 2020

1 Warning
⚠️ Unless you’re refactoring existing code, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#1956](https://github.com/ruby-grape/grape/pull/1956): Align implementation with rack spec - [@ioquatix](https://github.com/ioquatix).

Generated by 🚫 danger

@ioquatix
Copy link
Contributor Author

ioquatix commented Jan 8, 2020

I think this is okay to merge. @dblock

@dblock
Copy link
Member

dblock commented Jan 8, 2020

👍 merged, although I do worry about .to_a causing unexpected regressions (eg. streaming response)

@dblock dblock mentioned this pull request Jan 8, 2020
@ioquatix
Copy link
Contributor Author

ioquatix commented Jan 8, 2020

Rack middleware must return an array of [status, headers, body] and all the .to_a method is doing is forcing that. It doesn't change any of the individual fields, e.g. body is still body. You shouldn't be returning a rich object in order to support streaming.

That being said, I understand your concern.

@nbulaj
Copy link
Contributor

nbulaj commented May 6, 2020

Actually this changes broked our app after upgrade, check this one: #2030 (comment)
Could you check please @ioquatix ?

@ghiculescu
Copy link
Contributor

ghiculescu commented May 22, 2020

Should we add something about this to https://github.com/ruby-grape/grape/blob/master/CHANGELOG.md#130-20200111

I ended up here looking into #1966 (while upgrading Rack due to its recent CVE) and it'd be great if the changelog called that out somehow

@dnesteryuk
Copy link
Member

@ghiculescu of course, go ahead! 🙂

ghiculescu added a commit to ghiculescu/grape that referenced this pull request May 25, 2020
@ghiculescu
Copy link
Contributor

@ghiculescu of course, go ahead! 🙂

#2059

dblock pushed a commit to dblock/grape that referenced this pull request May 26, 2020
luong-komorebi added a commit to luong-komorebi/grape that referenced this pull request Jul 8, 2020
luong-komorebi added a commit to luong-komorebi/grape that referenced this pull request Jul 8, 2020
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.

6 participants