Open Bug 1742357 Opened 3 years ago Updated 1 year ago

geckodriver inappropriately returns "HTTP method not allowed" for not yet implemented commands

Categories

(Testing :: geckodriver, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: whimboo, Unassigned)

References

(Blocks 2 open bugs, )

Details

Originally reported as: https://github.com/mozilla/geckodriver/issues/1962

Running a geckodriver command that is not handled yet a HTTP method not allowed is returned instead of HTTP unknown command.

Interesting is that I cannot see that UnknownMethod is used at all in the Rust code:

https://searchfox.org/mozilla-central/search?q=UnknownMethod&path=testing%2F&case=false&regexp=false

It would be good to get a wdspec test added for error types that we don't have yet.

All the tests for get_computed_label and get_computed_role also fail with not allowed even we don't have some implemented yet. Making that change for geckodriver might also change the error output. As such marking both of them being blocked.

Blocks: 1744927, 1744929

geckodriver uses the Warp crate to handle all the HTTP requests. And as it looks like this problem is known and covered by:

https://github.com/seanmonstar/warp/issues/77

James, do you see a way to get this fixed with a workaround until Warp allows more customization or better handling of 404?

Flags: needinfo?(james)

Quickly discussed with James on Element but we don't see right now how to workaround. Also it's not severe enough to give it priority at the moment. Best might be to wait for a fix in warp.

I spent a bit of time looking at this, and it at least wasn't obvious how to get it working. It seems like you ought to be able to register a route that handles any request that didn't otherwise match, and set the error code in that. But I kept running into type errors which suggested that my approach wasn't quite right. In any case gettting the error code wrong here seems like it's unlikely to have a huge impact on users.

Flags: needinfo?(james)
You need to log in before you can comment on or make changes to this bug.