-
-
Notifications
You must be signed in to change notification settings - Fork 428
Entity bodies are not passed back for PATCH requests #553
Comments
This is likely the same issue as #427. It seems like QtWebKit only looks for a response on certain request types. We haven't found a workaround for this yet in Qt, but I'd be open to suggestions. |
In theory it should be possible because of I would assume that this method is what is being used now because the PATCH requests are made, they just don't have a body. Perhaps the "problem" is that But I'm not an expert on this stuff. I could be way off. |
In case anyone else with the same issue finds this, my work around ended up looking something like this. if (userAgent = window?.navigator?.userAgent).match /capybara-webkit/ || userAgent.match /PhantomJS/
type = 'post'
url = URI(url).setQuery('_method', 'patch').toString()
else
type = 'patch'
$.ajax
url: url
type: type
dataType: 'json'
contentType: 'application/json; charset=UTF-8'
data: data |
Hey! If someone has more info on that Qt WebKit issue, pls share it in the issue I created at QtWebKit issue tracker. |
I am just using "put" instead of "patch" for the time being until patch can pass through data properly. |
According to QTBUG-42456 the Qt side of this issue was fixed in 5.4.1. But after updating Qt: % qmake -v
QMake version 3.0
Using Qt version 5.4.1 in /usr/local/Cellar/qt5/5.4.1/lib Webkit still doesn't work with PATCH requests. Interestingly, 5.4.1 will send |
As a quick followup and for anyone else hunting down a solution, poltergeist running PhantomJS 2 (which uses Qt 5) handles PATCH requests as expected. |
It looks like we directly send the outgoing data upstream to Qt: https://github.com/thoughtbot/capybara-webkit/blob/master/src/NetworkAccessManager.cpp#L16 I'm not sure what we would be doing differently. @hiattp did you make sure to rebuild capybara-webkit after updating Qt? |
I uninstalled and reinstalled the gem after upgrading Qt, would there be another step to rebuilding? I did notice a different request structure (e.g. the headers noted above) and slightly different test errors after reinstalling so I felt confident it was using the new version of Qt but maybe I missed a step |
@hiattp nope, uninstalling and reinstalling should do it. I'll try to take a look at this soon. |
- NB: PATCH doesn't work in tests for reasons - ariya/phantomjs#11384 - thoughtbot/capybara-webkit#553
- NB: Using PUT now because PATCH doesn't work in tests for reasons - ariya/phantomjs#11384 - thoughtbot/capybara-webkit#553
Source modified: - http method 'PATCH' changed to 'PUT' in AJAX call due to an issue of capybara-webkit - thoughtbot/capybara-webkit#553
@jferris Sorry for the long delay; I couldn't make that test fail either. And yet switching from poltergeist to webkit still makes patch requests fail in my Rails suites (no bodies being sent). Very mysterious; I'll try to dig deeper. |
I had the same problem when running with I'm now on brew remove qt
brew install qt5
brew linkapps qt5
brew link --force qt5
gem uninstall capybara-webkit
bin/bundle install I'm now waiting to have the qt5 apt packages approved by Travis CI: travis-ci/travis-ci#4352 |
I have the same issue and I tried to make it work with Qt5.5 but patch requests still fail. (This is on ubuntu 14.04) |
I'm having the same issue on OS X (Yosemite). I'm running qt5:
|
Same here, OS X Yosemite running QT5
|
Same issues, no content body.
Changing to a PUT request worked for me. |
+1, Using PUT fixed the problem
|
+1, switched to PUT.
|
I'm having the same issue - PATCH requests send a correct CONTENT_LENGTH but no CONTENT_TYPE or body. Switching to PUT is not a viable option at the moment.
|
capybara-webkit cannot handle patch requests with a body. This lead to failing order requests because the ids param was missing, which in turn made the test suite fail now and then. (see thoughtbot/capybara-webkit#553)
Same issue on MacOS - Sierra with Qt 5.5.1
|
Closing this due to age. We can reopen if/when a way to replicate is provided using current versions |
Our app passes data in the entity body of a PATCH request via jquery. It works fine in the browser but when capybara-webkit makes the request the (rails) server never gets the entity body.
The problem is similar to #427
Is this also not supported by QtWebKit?
The text was updated successfully, but these errors were encountered: