Skip to content

Conversation

@reidj32
Copy link
Contributor

@reidj32 reidj32 commented Apr 24, 2020

Description

According to RFC 2616 and 7230, headers names are case insensitive.

When creating a new session, the webdriver server is checking the
request for a case sensitive Content-Type header. This causes the body
to be empty on session creation and will result in the IEDriverServer
complaining about missing capabilities.

This change will search for the Content-Type in a case insensitive
manner before capturing the value of the header.

Fixes #7986

Motivation and Context

Many modern JavaScript HTTP libraries set their headers to lower case before doing a request. Because IEDriverServer is looking for the Content-Type in a case sensitive manner, this prevents those tools from testing on IE.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

According to RFC 2616 and 7230, headers names are case insensitive.

When creating a new session, the webdriver server is checking the
request for a case sensitive Content-Type header. This causes the body
to be empty on session creation and will result in the IEDriverServer
complaining about missing capabilities.

This change will search for the Content-Type in a case insensitive
manner before capturing the value of the header.

Fixes SeleniumHQ#7986
@CLAassistant
Copy link

CLAassistant commented Apr 24, 2020

CLA assistant check
All committers have signed the CLA.

@reidj32
Copy link
Contributor Author

reidj32 commented Apr 24, 2020

I was unsure of where to add tests for this. If someone would be willing to point me in the right direction, I will happily add some if it is needed. I do believe many of the existing tests will cover this change when creating a new webdriver session.

@AutomatedTester AutomatedTester added the C-cpp C++ code is mostly Internet Explorer label May 1, 2020
@diemol diemol closed this Jul 12, 2020
@diemol diemol reopened this Jul 12, 2020
@diemol diemol changed the base branch from master to trunk July 12, 2020 19:51
@jimevans
Copy link
Member

Merged as 2dfe468. Thank you for your contribution!

@jimevans jimevans closed this Aug 12, 2020
@reidj32 reidj32 deleted the fix-content-type-header-check branch August 13, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cpp C++ code is mostly Internet Explorer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IEDriver] Error: No property named 'capabilities' or 'desiredCapabilities' found in new session request body. if Content-Length is not set

5 participants