http HEAD returning content body

Ask a Question related to Coldfusion Server Administration, Design and Development.

  1. #1

    Default http HEAD returning content body

    Using win2k and win2003 (IIS5 and IIS6) and CFMX6.1. I've just noticed when you
    send a request to the server like this:

    HEAD /file.cfm HTTP/1.1
    Host: [url]www.mysitename.com[/url]

    It returns the header and the content body. Whereas if I just do something
    like:

    HEAD /imagefile.gif HTTP/1.1
    Host: [url]www.mysitename.com[/url]

    It returns just the header (as is expected).

    So it seems to be something wrong with coldfusion, rather than IIS. Is this a
    bug/feature of cold fusion or is there something I can do in the config?

    Noodles Guest

  2. Similar Questions and Discussions

    1. #30329 [Opn->Fbk]: Error Fetching http body, No Content-Length, connection closed or chunked data
      ID: 30329 Updated by: dmitry@php.net Reported By: thetaphi@php.net -Status: Open +Status: Feedback...
    2. #30329 [Csd->Opn]: Error Fetching http body, No Content-Length, connection closed or chunked data
      ID: 30329 Updated by: lsmith@php.net Reported By: thetaphi@php.net -Status: Closed +Status: Open...
    3. head and body together?
      I am trying to put together a project, and was wondering if someone might be able to help me answer a question. Is it possible to marry a boned...
    4. HTTP POST fails on 4 megabyte body
      My ASP.NET 1.1 web service written in Visual C+ 1.1 (2003) fails with an error 400 if the body of the HTTP post exceeds about 4 megabytes. (I don't...
    5. Editable Region between </head> and <body>
      I am trying to insert an editable region between the </head> and <body> tags with no luck. My ecommerce app requires me to place some tokens there...
  3. #2

    Default Re: http HEAD returning content body

    How do you make the request? When I use the cfhttp tag it works for cfm files
    as expected:

    <cfhttp url="http://127.0.0.1:8500/index.cfm" method="head" throwOnError="Yes">
    <cfdump var="#CFHTTP#">
    <cfhttp url="http://127.0.0.1:8500/xmas_tree.gif" method="head"
    throwOnError="Yes">
    <cfdump var="#CFHTTP#">



    BKBK Guest

  4. #3

    Default Re: http HEAD returning content body

    I'm making the request using a telnet like program.

    When I make the request using cfhttp it seems to work fine, but that doesn't help me
    Noodles Guest

  5. #4

    Default Re: http HEAD returning content body

    Try setting the headers like a polite client:

    Accept-Encoding, Connection, Host, TE, User-Agent.
    MikerRoo Guest

  6. #5

    Default Re: http HEAD returning content body

    I've tried setting all those headers (with exception to TE as I don't know what
    that is) and others, but the result is the same.

    It looks to me to be a bug in CFMX6.1 as it's not just my server affected.
    I've tried a CFMX7 server (namely the macromedia.com server) and it doesn't
    have this problem.

    Noodles Guest

  7. #6

    Default Re: http HEAD returning content body

    are you sure this is not the webserver doing this ? for example it's normal for
    apache to treat head requests like get requests. it's up to the client to use
    the body part or throw it away, the response header in HEAD and GET should be
    (by RFC) exactly the same.

    have you tried to do the same on a plain ascii or html file (you are comparing
    a cf request -> ascii to a image request -> binary).

    Cheers,
    -S

    Telemedianer Guest

  8. #7

    Default Re: http HEAD returning content body

    I think you need to brush up on your RFC's, according to RFC2616, section 9:

    The HEAD method is identical to GET except that the server MUST NOT return a
    message-body in the response.

    So it looks like CFMX6.1 is breaking RFC's by returning the message body.

    I have tried the same process with a .txt file and it works fine, just seems
    to be pages parsed by cold fusion.

    Noodles Guest

  9. #8

    Default Re: http HEAD returning content body

    Not only does it break RFC's, by returning the whole page it's using up
    bandwidth that need not be used.

    Google may even be punishing sites that do this, as google and other search
    engines use HEAD to check if the page exists and if it has been changed since
    they were last spidered.

    Noodles Guest

  10. #9

    Default Re: http HEAD returning content body

    Maybe you're right.
    My CF7 servers respond correctly to the telnet clients I've tried.
    MikerRoo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139