Bug 179918

Summary: WebDriver: do not try to parse http body if method is not POST
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description Carlos Garcia Campos 2017-11-21 05:26:32 PST
As said in the spec:

5. If request’s method is POST:

  1. Let parse result be the result of parsing as JSON with request’s body as the argument. If this process throws an exception, return an error with error code invalid argument and jump back to step 1 in this overall algorithm.

  2. If parse result is not an Object, send an error with error code invalid argument and jump back to step 1 in this overall algorithm.

  Otherwise, let parameters be parse result.

Otherwise, let parameters be null.

6.3 Processing Model
https://w3c.github.io/webdriver/webdriver-spec.html#processing-model

Now, w3c tests are sending null as body of delete session command (it used to be just empty), making it fail with invalid argument.
Comment 1 Carlos Garcia Campos 2017-11-21 05:30:03 PST
Created attachment 327403 [details]
Patch
Comment 2 Carlos Garcia Campos 2017-11-21 08:56:54 PST
Committed r225083: <https://trac.webkit.org/changeset/225083>
Comment 3 Radar WebKit Bug Importer 2017-11-21 08:57:17 PST
<rdar://problem/35658285>