Skip to content

Update README to fix 404 error issue mounting Grape Using Rack::Cascade - #2089

Merged
dblock merged 2 commits into
ruby-grape:masterfrom
jonmchan:fix-1515-update_doc
Jul 14, 2020
Merged

dblock merged 2 commits into
ruby-grape:masterfrom
jonmchan:fix-1515-update_doc

Conversation

@jonmchan

Copy link
Copy Markdown
Contributor

Closes #1515.

@jonmchan
jonmchan force-pushed the fix-1515-update_doc branch from 1762e86 to 711f392 Compare July 11, 2020 05:02

@dblock dblock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! I have some nitpicks if you could please fix.

Comment thread CHANGELOG.md Outdated
#### Fixes

* Your contribution here.
* [#2089](https://github.com/ruby-grape/grape/pull/2089): Update README to fix 404 error issue mounting grape using rack::cascade - [@jonmchan](https://github.com/jonmchan).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rack::Cascade is capitals and quote it as Rack::Cascade

Error and issue is redundant ;) Maybe "Specify order of mounting Grape with Rack::Cascade in README"?

Comment thread README.md Outdated
run Rack::Cascade.new [Web, API]
```

**NOTE:** Order of loading apps using `Rack::Cascade` matters. The grape application must be last if you want to raise custom 404 errors from grape (such as `error!('Not Found',404)`). If the grape application is not last and returns 404 or 405 response, [cascade utilizes that as a signal to try the next app](https://www.rubydoc.info/gems/rack/Rack/Cascade). This may lead to undesirable behavior showing the [wrong 404 page from the wrong app](https://github.com/ruby-grape/grape/issues/1515).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't use NOTE like this elsewhere, just say Note that the order of loading ....
Capitalize Grape.

@jonmchan
jonmchan force-pushed the fix-1515-update_doc branch from 711f392 to 17c7190 Compare July 14, 2020 04:24
@jonmchan

Copy link
Copy Markdown
Contributor Author

Fixed

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.

error! method returns wrong content type "text/html" for 404 status code

2 participants