Skip to main content
Participating Frequently
November 21, 2012
Question

HTTP DELETE requests "hanging" when accessing a cfc (but not cfm)

  • November 21, 2012
  • 2 replies
  • 11472 views

I have what appears to be a configuration problem with Coldfusion 10 running on a Windows server with IIS 7.5

I have a javascript function that is sending REST requests to the server.   I am able to make GET, POST,and PUT  HTTP  requests to a REST CFC with no problems.

However, when I send an HTTP  DELETE request to the CFC, the code within the delete function in the CFC executes (the delete query in the function runs), but then I don't get a status code sent back to the browser.   It's not that I get an error status code . . . I get NOTHING.   No status code is returned at all and the request process in the browser just sits there and waits.

Since the code within the function is working, I've tried "forcing" the return of a status code using cfheader.   It doesn't work.

However, if I take the query from the CFC and put it in a file with a CFM extension and call it using the HTTP DELETE method ...I get a 203 status code back right away indicating that the deletion was successful.

Running the same process on a local development server has no problems.   The DELETE request to the CFC works fine.   So, it must be something with the way the production server is configured.

So, the chain of events seems to be

1)  HTTP DELETE request is made to REST on the production server

2)  Coldfusion successfully finds the CFC and executes the code in the correct function

3)  The status code (failure, success, not found ... whatever) gets "lost" and is never sent back to the browser.

The main difference seems to be what extension is on the file name.   It works in a .CFM file but doesn't work when the same code is called from a .CFC file.

I've been banging my head against the desk for hours working on this and just don't know where to go from here (other than write some sort of kludge that uses PUT to execute a delete query).  And since the problem seems to be on my production server I'm very nervous about doing "trial and error" settings changes.

    This topic has been closed for replies.

    2 replies

    Miguel-F
    Inspiring
    November 21, 2012

    Not sure if this will help either but have you specified any request restrictions in IIS?  In IIS go to your website and click on the Handler Mappings.  You should have one for '*.cfc', '*.cfm', etc.  Double-click your cfc handler '*.cfc' and it should open the Edit Script Map dialog.  That has a Request Restrictions... button on it.  Click that button and you get the Request Restrictions dialog.  Click on the Verbs tab and see how it is configured.  Compare that one to your cfm handler '*.cfm'.  Any differences?

    gtheilmanAuthor
    Participating Frequently
    November 21, 2012

    I did glance at those and they looked the same.   I went back again after your suggestion and looked again.

    They are identical. 

    Mapping is set to "FILE AND FOLDER"

    Verbs is set to "All Verbs"

    Access is set to "Script"

    While I was there, I tried a couple of changes to the cfchandler

    1)  I unchecked "Invoke handler only if request is mapped to ..." .    That didn't seem to change the behavior.

    2)  I unchecked "All verbs" and manually typed in "GET, POST, DELETE, PUT, OPTIONS, HEAD, TRACE, CONNECT".    Again, it didn't seem to change the way the the server was behaving.  The status code isn't being sent.

    Thanks for the suggestion.   It was a good thought.

    Miguel-F
    Inspiring
    November 21, 2012

    Have you tried monitoring the traffic with something like Fiddler (or something similar)? 

    What status codes/returns do you see?

    WolfShade
    Brainiac
    November 21, 2012

    Not sure if this will help, or not, but have you tried CFFLUSH after the delete command?

    ^_^

    gtheilmanAuthor
    Participating Frequently
    November 21, 2012

    Using CFFLUSH to push out the status code I "manually' generated with CFHEADER is not something I tried...but it's a good idea.

    Unfortunately, it doesn't seem to work.   Whatever is preventing the status code from being sent back to the browser also seems to be blocking output from the function.     The code on the server-side is getting run...it just doesn't want to send anything to the browser.

    Thanks for the suggestion.  I appreciate the help.