Closed Bug 1669445 Opened 4 years ago Closed 4 years ago

Improve error message when using an invalid Content-Type

Categories

(Testing :: geckodriver, defect, P1)

Default
defect

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
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.

Flags: needinfo?(james)
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.

Flags: needinfo?(james)

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: nobody → hskupin
Status: NEW → ASSIGNED
Priority: P3 → P1
Assignee: hskupin → james
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/30fffd612d77
Fix geckodriver documentation to pass in correct content type headers, r=whimboo,webdriver-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: