Ticket #3993 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Snoopy Class incompability with lighttpd/1.4.11 (and other httpds?)

Reported by: hakre Assigned to: rob1n
Priority: normal Milestone: 2.3
Component: General Version: 2.1.2
Severity: normal Keywords: snoopy http has-patch commit
Cc:

Description

I had the situation that an RSS request made to a server resultet in a 404 instead 200. I analyzed it and it came to my attention that using the Port within the Host Request header (as snoopy does) triggers that error.

Since HOST is not a valid http/1.0 (Request) Header(1), (2) applies here. Port 80 is the default Port for HTTP(2) it must not be part of the HOST Header. Since this is causing the Error with lighttpd/1.4.11 I suggest to modify the snoopy class:

file: wp-inludes/class-snoopy.php
line: 799ff
change from:
			if(!empty($this->port))
				$headers .= ":".$this->port;

change to:
			if(!empty($this->port))
				if ($this->port != 80) {
					$headers .= ":".$this->port;
				}

BTW this type of HTTP Implementation is similar to other stable and mature libraries on various platforms.

(1) see Full-Request in http://www.faqs.org/rfcs/rfc1945.html

(2) see 14.23 in http://www.faqs.org/rfcs/rfc2616.html

Attachments

3993.diff (0.5 kB) - added by rob1n on 05/04/07 03:54:01.

Change History

03/19/07 01:44:44 changed by hakre

i found another report about this issue in the snoopy bugtracker: http://sourceforge.net/tracker/index.php?func=detail&aid=1671104&group_id=2091&atid=102091

03/28/07 00:33:27 changed by foolswisdom

  • milestone changed from 2.1.3 to 2.2.

04/12/07 18:16:15 changed by foolswisdom

  • milestone changed from 2.2 to 2.3.

05/04/07 03:54:01 changed by rob1n

  • attachment 3993.diff added.

05/04/07 03:54:18 changed by rob1n

  • keywords changed from snoopy http to snoopy http has-patch 2nd-opinion.
  • owner changed from anonymous to rob1n.
  • status changed from new to assigned.

Send it upstream?

05/04/07 04:06:25 changed by rob1n

  • keywords changed from snoopy http has-patch 2nd-opinion to snoopy http has-patch commit.

05/10/07 01:26:57 changed by rob1n

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5424]) Don't add port if port == 80 (default port). fixes #3993