Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#7224 closed enhancement (duplicate)

wp_get_http, discover_pingback_server_uri does not consider HTTP chuck format

Reported by: lilyfan Owned by: jacobsantos
Priority: normal Milestone:
Component: General Version: 2.6
Severity: major Keywords:
Cc: Focuses:

Description

wp_get_http() at wp-includes/functions.php, discover_pingback_server_uri() at wp-includes/comment.php speaks HTTP with fcoskopen(), fputs(), fgets(), fread(). But, thease codes does not consider HTTP chunk format.
If the server returns chunk format, received data will be malformed.
The chunk format is described in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

To handle chunk format, check Transfer-Encoding field in HTTP header, and read chunk-size and the content.

Attachments (2)

pingback.patch (355 bytes ) - added by lilyfan 18 years ago.
Patch for discover_pingback_server_uri()
pingback.diff (355 bytes ) - added by lilyfan 18 years ago.
Patch for discover_pingback_server_uri()

Download all attachments as: .zip

Change History (11)

@lilyfan
18 years ago

Patch for discover_pingback_server_uri()

@lilyfan
18 years ago

Patch for discover_pingback_server_uri()

#1 @anonymized_218323
18 years ago

HTTP/1.0 does not understand chunked-encoding, therefore, should not accept the header and ignore it. If it is received, then the standard states that we must send a 501 response back.

#2 @anonymized_218323
18 years ago

  • Type defectenhancement

#3 @DD32
18 years ago

HTTP/1.0 does not understand chunked-encoding

The function in question should be set to use 1.0, I believe the function in question uses HTTP/1.1, which is probably the reason the server is returning that content type.

#4 @lilyfan
18 years ago

  • Milestone 2.92.7

#5 @jacobsantos
18 years ago

  • Owner changed from anonymous to jacobsantos

#6 @jacobsantos
18 years ago

  • Status newassigned

#7 @jacobsantos
18 years ago

I think the easiest way to fix this problem is to use HTTP 1.0 instead.

#8 @anonymized_218323
18 years ago

This can use the new HTTP API WP_Http method for decoding chunked transfer-encoding messages. I'm not sure if the team wants to convert those functions over to the new HTTP API yet. I think the HTTP API is stable enough, but there does seem to still be problems.

#9 @jacobsantos
18 years ago

  • Keywords HTTP chuck removed
  • Milestone 2.7
  • Resolutionduplicate
  • Status assignedclosed

Superceded by #7793.

Note: See TracTickets for help on using tickets.