Problem/Motivation

PayPal for Payment uses drupal_http_request() to communicate with the PayPal servers. However, PayPal now requires HTTP 1.1, while drupal_hhtp_request() still enforces 1.0.

Proposed resolution

Allow calling code to specify an HTTP version.

Remaining tasks

None.

User interface changes

None.

API changes

Full backwards compatibility, with the possibility to specify HTTP 1.1 instead of the default 1.0.

CommentFileSizeAuthor
#1 drupal_2242123_1.patch1.25 KBxano

Comments

xano’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB
sawtell’s picture

I have tested the patch which works successfully.

Fidelix’s picture

Status: Needs review » Reviewed & tested by the community

This is a very simple change, and it doesn't break any existing functionality.

Can we please get this in?

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: drupal_2242123_1.patch, failed testing.

Status: Needs work » Needs review

Xano queued 1: drupal_2242123_1.patch for re-testing.

damien tournoud’s picture

Status: Needs review » Needs work

drupal_http_request() is an HTTP/1.0 client. Making it a HTTP/1.1 client requires more than just this. In particular it requires supporting chunked responses. From RFC2616:

A recipient MUST be able to parse and decode the chunked transfer coding.

dgtlmoon’s picture

yes that is correct, HTTP/1.1 support is probably in D8 #106506: drupal_http_request() does not handle 'chunked' responses - Make it support HTTP 1.1 , and requires chunked handling

nlamot’s picture

If you want to do a HTTP 1.1 request, you can always use the cURL HTTP Request module.
When you enable it, you can replace drupal_http_request with chr_curl_http_request, it follows the same API as drupal_http_request.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.