tracker issue : CF-3763348

select a category, or use search below
(searches all categories and all time range)

Problem with CF11 and HTTP

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): David Byers / David Byers (David Byers)

Created: 05/20/2014

Components: Net Protocols, HTTP

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Mac 10.9

Vote Count: 2

Listed in the version Issues Fixed doc
I've run into a problem (I think) with http in ColdFusion 11 and I'm wondering if this is a known issue. I'm doing a pretty straightforward HTTP call to the Google Places API in order to retrieve a JSON packet of information.

I've got this script running on two Ubuntu VMs (Parallels on my Mac).
One running Ubuntu 12.04 running CF10 update 13.
One running Ubuntu 14.04 running CF11.

The CF10 request returns the JSON packet as expected, but the CF11 request returns a 404 response from Google.

Have you heard of any problems with http() in CF11?

Here's my code.  The values for "reference" and "api Key" are variables, but I've hard coded them here if you wanted to test it.

	// Set up an HTTP service //
	variables.HTTP = new http();

	// Set the method, character set and the URL //

	// Add the reference //

	// Add the Google API Key //

	// Add the sensor parameter //

	// Send the request to Google //
	variables.Response = variables.HTTP.send().getPrefix();


----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3763348

External Customer Info:
External Company:  
External Customer Name: myScreenNameWasTaken
External Customer Email:  
External Test Config: Parallels Virtual Machines running on a MacBook Pro.

1 x Ubuntu 12.04 running ColdFusion 10 updater 13

1 x Ubuntu 14.04 running ColdFusion 11



I have analyzed the cause for the issue. The issue is happening because of the host header. In ColdFusion 10 if the HTTP/HTTPS request is happening over default ports (80 and 443) the host header won’t include the port information in the host header. But in ColdFusion 11 the host header includes the port information for default ports as well. This is valid according to the HTTP 1.1 spec. New Apache HTTPComponents version changed this behavior. The returning 404 for the request when the host header contains the default port 443 along with the host name. The google maps server should accept such host header. Host = "Host" ":" host [ ":" port ] ; Section 3.2.2 A "host" without any trailing port information implies the default port for the service requested (e.g., "80" for an HTTP URL). For example, a request on the origin server for <> would properly include: GET /pub/WWW/ HTTP/1.1 Host: A client MUST include a Host header field in all HTTP/1.1 request messages When I added the host header manually without the default port information it worked in ColdFusion 11. Workaround: variables.HTTP.addParam( type="header", name="Host", value="" ); I will raise a bug with Apache HC as well to not to include the default port information in the host header and update the ticket for the same.
Comment by S V.
12058 | May 26, 2014 05:02:33 AM GMT
This bug directly affects our ability to communicate with a third party http server.
Vote by External U.
12061 | June 03, 2014 07:54:32 PM GMT
We are working with several 3rd party APIs that this is affecting. We cannot upgrade to CF11 until this is fixed. Adding a HOST header has not worked for us.
Vote by External U.
12062 | July 29, 2014 10:38:28 AM GMT
Tried for both port numbers, port 80 and 443. Its working as expected.
Comment by Akhila K.
12059 | September 02, 2014 02:14:15 AM GMT
Hi all, I've verified this is fixed in CF11 Update 3. Prior to this update, CF11 always sent host:port (and Google returned 404). In Update 3, it omits :port if port is 80 or 443 (and Google no longer returns 404). Thanks!, -Aaron
Comment by External U.
12060 | November 02, 2014 10:47:50 PM GMT