Comments (21)
Are other people seeing this too when posting multipart forms? I'm curious if it's something specific to my setup which I could debug.
from capybara-webkit.
I got this area too today. Seems if the form does not have an attachment, it will bomb.
from capybara-webkit.
Got this as well...
from capybara-webkit.
Had a look at this one myself, we get an error, slightly different though:
Internal Server Error
bad content body
WEBrick/1.3.1 (Ruby/1.8.7/2011-02-18) at 127.0.0.1:56925
Looked through the webkit_server cpp code, and couldn't see where it might be a problem, thought maybe it was linkDelegationPolicy handling but no luck there.
from capybara-webkit.
Got the same error. Turns out that rack is raising:
EOFError: bad content body
right here: https://github.com/rack/rack/blob/master/lib/rack/request.rb#L182
unless @env["rack.request.form_hash"] = parse_multipart(env)
on the next request after submitting multipart form.
from capybara-webkit.
I'm having the same issue with same error as fxposter (bad content body). Any workarounds for this?
from capybara-webkit.
I have done this in my forms view code (HAML). A bit hacky, but it works.
:html => { :multipart => !Rails.env.test? }
from capybara-webkit.
Unfortunately that will not test the use of the form to submit attachments.
from capybara-webkit.
@metaskills this is definitely not an option.
from capybara-webkit.
Same problem here. Any hints to workarounds appreciated.
from capybara-webkit.
Any progress here? This is really the only thing holding us back on using this great gem.
I'd love to help out myself, but I have no idea how to go about debugging this.
from capybara-webkit.
Same here. The form gets submitted, but the redirect (the next GET request) fails with "Unable to load URL", if I turn off multipart forms, it works.
from capybara-webkit.
Getting the same issue as @excepttheweasel. Looking for a work-around... anyone have progress here?
Internal Server Error
bad content body
WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18) at 127.0.0.1:56993
from capybara-webkit.
This worked for me:
# config/environments/test.rb
class CapybaraWebkitFixer
def initialize(app)
@app = app
end
def call(env)
if env['REQUEST_METHOD'] == "GET" && env['CONTENT_TYPE'] && env['CONTENT_TYPE'] =~ /^multipart/
env['CONTENT_TYPE'] = nil
end
@app.call(env)
end
end
Rails.application.config.middleware.insert_after Rack::Runtime, CapybaraWebkitFixer
from capybara-webkit.
+1 I'm getting the same error when submitting a multi-part form w/o any file attachments.
Internal Server Error
can't convert nil into Hash
WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18)
from capybara-webkit.
@ebeigarts: that hack fixes the behavior for me too. I have this problem with a Rails 3.1.0 app on ruby 1.9.2p312 (2011-08-11 revision 32926) [x86_64-darwin11.1.0].
A few debugging hints for capybara-webkit..
Show server debug output:
lib/capybara.rb
in the gem: set Thin::Logging.silent = false
in run_default_server
to see this error.
Enable a lot of client debug output:
Use: Capybara.javascript_driver = :webkit_debug
instead of
Capybara.javascript_driver = :webkit
This shows the wire-protocol for the webkit driver, which may come in handy.
from capybara-webkit.
This has been fixed in #162
from capybara-webkit.
Works like a charm, thank you @ebeigarts! :)
from capybara-webkit.
When will this be available for a general "gem install"?
from capybara-webkit.
A new version of the gem with this fix would indeed be great.
from capybara-webkit.
A gem was released with this fix a while ago.
from capybara-webkit.
Related Issues (20)
- Issue rendering modal (SweetAlert) in CapybaraWebkit HOT 5
- Unable to find css because it redirects to /login HOT 1
- Status code 0 when injecting javascript file to be loaded over HTTPS HOT 1
- Capybara::Webkit::Browser.command becomes out of sync reading @connection responses, causing JSON::ParserError HOT 1
- Deprecation warning on normalize_whitespace with capybara >= 3.0 HOT 15
- EOFError: end of file reached on qt 5.9? HOT 3
- Follow 308 redirects HOT 8
- I am getting error when bootstrap from Window to Linux machine HOT 1
- Failing to install on mac OS 10.13.6 HOT 7
- Capybara-webkit +qt5.5 fails with X Code 10 HOT 31
- Capybara README remark clarification HOT 1
- Failing to build 1.15 on Alpine while 1.14 builds fine HOT 2
- fatal: reference is not a tree: 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 HOT 2
- ~
- Unable to maximize the window HOT 3
- Consider adding flexbox troubleshooting to README
- Upgrading Capybara to latest version makes Gitlab CI fail
- -v
- Capybara::Webkit::ConnectionError: webkit_server failed to start.
- No longer maintained? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capybara-webkit.