Skip to content

Commit

Permalink
Rewind the body before reading it (#150)
Browse files Browse the repository at this point in the history
* Rewind the body before reading it

* Update CHANGELOG.md
  • Loading branch information
grantspeelman committed Jan 7, 2024
1 parent fd5a631 commit e1a2b0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Removed the update generator and reduced options for install generator [PR 149](https://github.com/shakacode/cypress-on-rails/pull/149)

### Fixed
* fix update index.js in install generatpr [PR 147](https://github.com/shakacode/cypress-on-rails/pull/147) by [Judahmeek]
* fix update index.js in install generator [PR 147](https://github.com/shakacode/cypress-on-rails/pull/147) by [Judahmeek]
* Support rails 7.1 by adding content-type header to generated on-rails.js file [PR 148](https://github.com/shakacode/cypress-on-rails/pull/148) by [anark]
* Rewind body before reading it [PR 150](https://github.com/shakacode/cypress-on-rails/pull/150)

## [1.16.0]
[Compare]: https://github.com/shakacode/cypress-on-rails/compare/v1.15.1...v1.16.0
Expand Down
1 change: 1 addition & 0 deletions lib/cypress_on_rails/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def handle_command(req)
# Halt the middleware if an Rack Env was returned by `before_request`
return maybe_env unless maybe_env.nil?

req.body.rewind
body = JSON.parse(req.body.read)
logger.info "handle_command: #{body}"
commands = Command.from_body(body, configuration)
Expand Down

0 comments on commit e1a2b0a

Please sign in to comment.