Improve error message when using an invalid Content-Type
Categories
(Testing :: geckodriver, defect, P1)
Tracking
(firefox83 fixed)
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: whimboo, Assigned: jgraham)
References
()
Details
Attachments
(1 file)
As we were informed via a GitHub issue our documentation is outdated for the stand-alone interaction with geckodriver via curl:
https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html#standalone
Given that the content type isn't set to application/json
all the commands error out with:
SessionNotCreatedException: Message: Unable to find a matching set of capabilities
The message here isn't ideal and maybe we can make it more verbose so that it says that an invalid content type has been used?
James, would it be something you can do, including the doc changes given that it has been introduced in bug 1648964? Thanks.
Assignee | ||
Comment 1•4 years ago
|
||
In [4]: requests.post("http://127.0.0.1:4444/session", json={}, headers={"content-type": "text/plain"}).text
Out[4]: '{"value":{"error":"unknown error","message":"Invalid Content-Type","stacktrace":""}}'
It seems to me that we are returning a reasonable exception in this case.
Reporter | ||
Comment 2•4 years ago
|
||
Indeed. Maybe that was the overlap with the acceptInsecureCerts
capability and the Firefox binary located at /usr/bin/firefox
.
I will go ahead and fix our documentation.
Assignee | ||
Comment 3•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
Description
•