Bug 179918 - WebDriver: do not try to parse http body if method is not POST
Summary: WebDriver: do not try to parse http body if method is not POST
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-21 05:26 PST by Carlos Garcia Campos
Modified: 2017-11-21 08:57 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.65 KB, patch)
2017-11-21 05:30 PST, Carlos Garcia Campos
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>