• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CGI.PATH_INFO is blank in CF 10

Explorer ,
Feb 21, 2013 Feb 21, 2013

Copy link to clipboard

Copied

I know this was an issue that was supposedly fixed in the first update, but I applied that and I'm still experiencing the error.  Any ideas?

Version says ColdFusion 10,283649

Views

33.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

CGI.PATH_INFO should be empty for a request URL like http://myserver/index.cfm

In case your URL is like http://myserver/index.cfm/hello, you will get the CGI.PATH_INFO as “/hello”

JRun which was the underlying server for CF 9 and earlier was actually giving a wrong value for PATH_INFO and that is why you see this change in behavior. You can also see this http://docs.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpServletRequest.html#getPathInfo().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Thank you for your response, but that is not the issue.  CGI.PATH_INFO is always blank, no matter where I am within the directory structure.  This was a bug (3305486) in CF10 but was supposedly fixed in updater 1:

http://helpx.adobe.com/coldfusion/kb/coldfusion10-update-01.html

I have installed that update.  In fact, I have installed and reinstalled it several times.  It has never fixed the issue for me, and I'm wondering if there are any other suggestions.

My machine is:

Windows 2008 R2

IIS 7.0

ColdFusion 10,283649

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Can you please reconfigure the connector after applying the update (CF 10 Update 1) and check if this still does not work for you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

It works OK for me on CF10 using the inbuilt web server. Can you test whether it is likewise with you? It might be something peculiar to IIS that is still broken, or a vagary of your config..?

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 22, 2013 Feb 22, 2013

Copy link to clipboard

Copied

Hi ColdFusionSmurf,

I just verified that ColdFusion 10,282462 (w/ 0 CF updates installed) on IIS7.5 correctly returns CGI.PATH_INFO as "/foo" for "http://localhost/index.cfm/foo"

#3305486, which Update 1 fixed, was specific to URL Rewriting.

Can you please post an example of a URL path for which CGI.PATH_INFO is empty but shouldn't be?

Thanks,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

I just discovered this problem after migrating from CF9 to CF10.  I have applied all of the patches and have been relying on CGI.PATH_INFO in a breadcrumb tag.  That tag is all over my website and now returns only the 'home' link which doesn't use the CGI.PATH_INFO tag. 

This page is testing the the CGI.PATH_INFO and is returning nothing 

http://www.ute-sei.org/English/sue.cfm

Sue

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

Hello,

As per the Servlet spec, CGI.PATH_INFO should be empty for a request URL like http://myserver/index.cfm

In case your URL is like http://myserver/index.cfm/hello, you will get the CGI.PATH_INFO as “/hello”

 

JRun which was the underlying server for CF 9 and earlier was actually giving a wrong value for PATH_INFO and that is why you see this change in behavior. You can refer to http://docs.oracle.com/javaee/1.2.1/api/javax/servlet/http/HttpServletRequest.html#getPathInfo().

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

I am getting NOTHING regardless of how deep the path is.  The breadcrumb code which was working in CF9 relies on this and right now a page like:

http://www.ute-sei.org/English/committees/tech-change/2012/minutes-sub-nov-21-2012.cfm

has no breadcrumbs because that path provides nothing.

This is broken and means I'm going to have to make coding changes that I shouldn't have to.

Sue

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

@sduncanute

Sorry to hear you're running into the same problems.  Unfortunately, I was never able to fix it and the people around here don't seem to believe me and therefore aren't very helpful.  I don't know how much plainer you can say "I'm never getting a value in my PATH_INFO" but apparently it's not getting through.

My suggestion to you would be to replace all instances of CGI.PATH_INFO with something like request.cgiPath and then set that request variable in your application.cfc.  I ended up doing:

<cfset request.cgiPath = getPageContext().getRequest().getRequestURI() />

That pretty much gave me the same thing, and I really needed to solve the issue immediately.  I don't know about you but I couldn't afford to wait around for someone in these forums to actually believe me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

Hello,

JRun was the underlying server for CF 9 and earlier was actually giving a wrong value for PATH_INFO. In CF 10 there is a change in the behavior. Thus with CF10, you will have to use http://myserver/index.cfm/hello, you will get the CGI.PATH_INFO as “/hello”

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

I don't have ANY urls have have a /anything after the .cfm file so Anit, repeating your message over and over is not helpful, nor does it add anything to this thread.

Again, there is nothing in that variable no matter now many subdirectories down the file is.

Sue

p.s. @ColdFusionSmurf, thanks for the message and I'll look at implementing something like that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2013 Mar 13, 2013

Copy link to clipboard

Copied

Hello Sue,

Apologies for being not of much help to you. You can alternatively use PATH_TRANSLATED.

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

sduncanute wrote:

I don't have ANY urls have have a /anything after the .cfm file so Anit, repeating your message over and over is not helpful, nor does it add anything to this thread.

I think rather than getting snippy, you should perhaps actually read what Anit has been saying. They explained the situation perfectly well. The problem is that you're either not reading it, or not understanding it.

I don't have ANY urls have have a /anything after the .cfm file

Precisely. Given CGI.PATH_INFO is specifically for returning the stuff after the .cfm file, it stands to reason that it's empty if you don't have anything there.

You need to understand that the behaviour on previous versions of ColdFusion - wherein CF supposedly put the file path (eg: /path/to/the/file.cfm) into CGI.PATH_INFO - was a bug. It was never supposed to be in there. CF10 fixed this.

To try to repeat what Anit and Aaron have said, given this path:

/physical/path/to/file/on/the/file/system.cfm/some/other/stuff?param=value

  • CGI.SCRIPT_NAME
  • CGI.PATH_INFO
  • CGI.QUERY_STRING

That is how CF10 behaves, and that's how it's supposed to behave. This is correct behaviour.

(that said, that's exactly how CF9.0.2 behaves for me as well).

Does that make sense?

And is this not what you too are seeing?

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

Excellent explanation, Adam   I think the color-coding did the trick nicely!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 18, 2013 Mar 18, 2013

Copy link to clipboard

Copied

Yes, Adam, the colour coding does help.  The problem is, I was dealing with a chunk of code that was written by someone else, years ago and it worked fine up until recently.

Your colour coding shows that the CGI.PATH_INFO will no longer work for me and should not have worked before (but it has been since... 2004 or earlier).

If I use getDirectoryFromPath(CGI.SCRIPT_NAME)  it gives me what I used to get from CGI.PATH_INFO.

Sue

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

Hi Anit,

CF10 still returns CGI.PATH_INFO as CGI.SCRIPT_NAME when default document is omitted.

Example: CGI.PATH_INFO for http://domain.com/dir/ is /dir/index.cfm

However, getPageContext().getRequest().getPathInfo() is empty for the same.

Thanks,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

home
»  English
»  sue.cfm


testing CGI.SCRIPT_NAME is /English/sue.cfm
CGI.PATH_INFO is
getDirectoryFromPath(CGI.SCRIPT_NAME) /English/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

Hi Sue,

Looks like getDirectoryFromPath(CGI.SCRIPT_NAME) is what you want then, right?

Thanks,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

Hi Aaron,

This is an example set which you can try to see the functionality:-

<cfoutput>

          <h1>Test CGI Outputs</h1>

                    <div id="videogallery">

                              Software: #CGI.SERVER_SOFTWARE#<br />

                              ColdFusion Version: #server.ColdFusion.ProductVersion#<br />

                              Path Info: #CGI.PATH_INFO#<br />

                              Script Name: #CGI.SCRIPT_NAME#<br />

                              Path Translated: #CGI.PATH_TRANSLATED#<br />

                              <cfdump var="#CGI.PATH_INFO#">

                    </div>

</cfoutput>

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2013 Mar 15, 2013

Copy link to clipboard

Copied

Hi Anit,

I see CF10's CGI.PATH_INFO is still incorrect in IIS6 and IIS7 when URL does not contain a file name or extra path info, and when the directory contains a default document.

Steps to Reproduce:

1) Place this code into C:\Inetpub\wwwroot\dir\index.cfm

<cfoutput>

IIS: #CGI.SERVER_SOFTWARE#<br />

Translated: #CGI.PATH_TRANSLATED#<br />

Script: #CGI.SCRIPT_NAME#<br />

Path Info CF: #CGI.PATH_INFO#<br />

Path Info Java: #getPageContext().getRequest().getPathInfo()#

</cfoutput>

2) Browse to URL http://localhost/dir/

3) See CF10's CGI.PATH_INFO is incorrect (/dir/index.cfm) in IIS6 and IIS7 and correct (empty string) in IIS7.5 and IIS8.

IIS: Microsoft-IIS/6.0

Translated: C:\Inetpub\wwwroot\dir\index.cfm

Script: /dir/index.cfm

Path Info CF: /dir/index.cfm (bug?)

Path Info Java:

IIS: Microsoft-IIS/7.0

Translated: C:\inetpub\wwwroot\dir\index.cfm

Script: /dir/index.cfm

Path Info CF: /dir/index.cfm (bug?)

Path Info Java:

IIS: Microsoft-IIS/7.5

Translated: C:\inetpub\wwwroot\dir\index.cfm

Script: /dir/index.cfm

Path Info CF:

Path Info Java:

IIS: Microsoft-IIS/8.0

Translated: C:\inetpub\wwwroot\dir\index.cfm

Script: /dir/index.cfm

Path Info CF:

Path Info Java:

I did not check the same on IIS5.1, so this should probably be verified as well since CF10 is also supported on IIS5.1.

Thanks,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 27, 2013 Mar 27, 2013

Copy link to clipboard

Copied

Updated: Added "And getPageContext().getRequest().getPathInfo() is always correct, regardless of IIS version."

Hi Anit,

Do you see the same?  Just want to verify before logging a bug.  Repro is simple..

itisdesign wrote:

Hi Anit,

I see CF10's CGI.PATH_INFO is still incorrect in IIS6 and IIS7 when URL does not contain a file name or extra path info, and when the directory contains a default document.

Steps to Reproduce:

1) Place this code into C:\Inetpub\wwwroot\dir\index.cfm

Btw, IIS7.5 and IIS8 are correct.  And getPageContext().getRequest().getPathInfo() is always correct, regardless of IIS version.

Thanks!,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 29, 2013 Mar 29, 2013

Copy link to clipboard

Copied

Hi,

The behavior of CGI.PATH_INFO attribute will remain the same irrespective of the version IIS with ColdFusion 10.

And if you look at the screen shot below, the functionality is still the same in IIS8 as well for getPageContext().getRequest().getPathInfo().


itisdesign wrote:

Updated: Added "And getPageContext().getRequest().getPathInfo() is always correct, regardless of IIS version."

Thanks!,

-Aaron

Untitled.jpg

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 03, 2013 Apr 03, 2013

Copy link to clipboard

Copied

Hi Anit,

Sorry for the delay; I am on vacation.  Did you check IIS6 and IIS7?

Anit_Kumar wrote:

The behavior of CGI.PATH_INFO attribute will remain the same irrespective of the version IIS with ColdFusion 10.

20130403_CGIPathInfoWrongInIIS6.jpg

20130403_CGIPathInfoWrongInIIS7.jpg

IIS6:

- CGI.PATH_INFO: /dir/index.cfm

- getPageContext().getRequest().getPathInfo(): [empty string]

IIS7:

- CGI.PATH_INFO: /dir/index.cfm

- getPageContext().getRequest().getPathInfo(): [empty string]

IIS7.5:

- CGI.PATH_INFO: [empty string]

- getPageContext().getRequest().getPathInfo(): [empty string]

IIS8:

- CGI.PATH_INO: [empty string]

- getPageContext().getRequest().getPathInfo(): [empty string]

That is what I was trying to say.  Sorry if there was any confusion.  Should I log a bug for CF10's CGI.PATH_INFO in IIS6 & IIS7?

Thanks!,

-Aaron

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 08, 2013 Oct 08, 2013

Copy link to clipboard

Copied

LATEST

I'm also getting [empty string]

CF 10,0,11,285437

Update Level /C:/ColdFusion10/cfusion/lib/updates/chf10000011.jar 

IIS 7.5 w/ CF connector reinstalled

URL : http://localhost/test/test.cfm;lat=50;long=20;scale=32000

CGI.PATH_INFO: [empty string]

getPageContext().getRequest().getRequestUri() : /test/test.cfm;lat=50;long=20;scale=32000

related quesiton: http://stackoverflow.com/questions/19253722/is-it-possible-to-access-the-matrix-parameters-name-valu...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation