Bug Report #3830

Request_Client_External cURL driver does not set headers (3.1/develop)

Added by Mike Matz almost 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:03/10/2011
Priority:HighDue date:
Assignee:Sam de Freyssinet% Done:

100%

Category:Core
Target version:v3.1.2
Resolution: Points:

Description

Request_Client_External does not properly set request headers when using _curl_execute driver.

Associated revisions

Revision cced6db5
Added by Sam de Freyssinet almost 4 years ago

Fixes #3830, no test yet

Revision 0ff14167
Added by Sam de Freyssinet almost 4 years ago

Refs #3830, provided better merging of request options with curl options.

History

#2 Updated by Jeremy Bush almost 4 years ago

  • Target version set to v3.1.2

Your fix would need a unit test before we can merge it.

#3 Updated by Woody Gilk almost 4 years ago

How can it be unit tested? It does things that would hake unit testing unpredictable.

#4 Updated by Woody Gilk almost 4 years ago

  • Assignee set to Sam de Freyssinet

#5 Updated by Jeremy Bush almost 4 years ago

I don't see how it's unpredictable. You set known headers in the request (easily done in a unit test provider), and you need to be able to verify that they will be sent in the request. It probably involves a change in the internal API, but every change needs to be tested.

#6 Updated by Mike Matz almost 4 years ago

Unit testing is possible but would involve mocking the cURL library itself, which has a procedural API. An easier solution might be to actually run full cURL requests against a preconfigured local URL that simply spits the contents of the request back to the client; that could be used to test each of the HTTP request mechanisms (http, curl and native) but seems a little sloppy and requires that "sounding board" URL be active when tests are running. I'm not too familiar with the current test suite but I'm guessing it's not ideal to depend on a local web server being configured properly and/or network access being available in order to complete the tests?

#7 Updated by Jeremy Bush almost 4 years ago

Right, we don't want to do that. I think inspecting the internals of the class would be better.

#8 Updated by Sam de Freyssinet almost 4 years ago

  • Status changed from New to Assigned
  • Priority changed from Normal to High

#9 Updated by Sam de Freyssinet almost 4 years ago

Unfortunately, this is one area where HTTP pwns the cURL library.

#10 Updated by Sam de Freyssinet almost 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:cced6db5b03c64d3cdf9ada942ab0fee08c3b08d.

Also available in: Atom PDF