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

Rewrite using Rails middleware #6

Merged
merged 21 commits into from
Feb 24, 2019
Merged

Conversation

jorgemanrubia
Copy link
Owner

@jorgemanrubia jorgemanrubia commented Feb 24, 2019

Instead of patching ‘render’, the engine now configures a rack middleware to analyze requests and modify responses.

This is much more robust since it is now independent of how the render method is invoked (or if it's invoked at all).

This will handle errors consistently now in both development and production mode. For development mode, I still had to patch ActionDispatch::DebugExceptions to discriminate remote requests we want to handle with turbolinks.

UPDATE: it's performing a full html replace now. See #7. Fixed in #8

Pending

  • Test that <script> in responses are executed
  • Add rails 6 test

@jorgemanrubia jorgemanrubia changed the title [WIP] Rewrite using Rails middleware Rewrite using Rails middleware Feb 24, 2019
@jorgemanrubia jorgemanrubia merged commit 6b7c0e9 into master Feb 24, 2019
@jorgemanrubia jorgemanrubia deleted the handle-internal-server-error branch February 24, 2019 14:42
@jorgemanrubia jorgemanrubia restored the handle-internal-server-error branch February 24, 2019 14:42
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.

Returned <script> tags are not executed Handling 500s
1 participant