Bug in cfhttp - no redirect on post

Hi,

I just submitted this to the tracker -
https://luceeserver.atlassian.net/browse/LDEV-781

In 4.5.2.018 there is a bug where cfhttp does not redirect if the method is
post. A simple test case:

Trying with method=GET

Trying with method=POST

Regards,
Hugo–
Hugo Ahlenius
@Hugo_Ahlenius

What’s the returned status code of that bitly link if you POST?On 11 March 2016 at 10:46, Hugo Ahlenius <@Hugo_Ahlenius> wrote:

Hi,

I just submitted this to the tracker -
[LDEV-781] - Lucee

In 4.5.2.018 there is a bug where cfhttp does not redirect if the method is
post. A simple test case:

Trying with method=GET

Trying with method=POST

Regards,
Hugo


Hugo Ahlenius
@Hugo_Ahlenius


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/09ad01d17b83%243c6306b0%24b5291410%24%40oxel.net.
For more options, visit https://groups.google.com/d/optout.

Geoff Parkhurst wrote on 2016-03-11:

What’s the returned status code of that bitly link if you POST?

302> On 11 March 2016 at 10:46, Hugo Ahlenius <@Hugo_Ahlenius> wrote:

Hi,

I just submitted this to the tracker -
[LDEV-781] - Lucee

In 4.5.2.018 there is a bug where cfhttp does not redirect if the
method is post. A simple test case:

Trying with method=GET

Trying with method=POST

Regards,
Hugo


Hugo Ahlenius
@Hugo_Ahlenius

– Love Lucee? Become a supporter and be part of the Lucee project
today! - http://lucee.org/supporters/become-a-supporter.html — You
received this message because you are subscribed to the Google Groups
“Lucee” group. To unsubscribe from this group and stop receiving emails
from it, send an email to lucee+unsubscribe@googlegroups.com. To post
to this group, send email to lucee@googlegroups.com. To view this
discussion on the web visit
https://groups.google.com/d/msgid/lucee/09ad01d17b83%243c6306b0%24b5291410
%24%40oxel.net.
For more options, visit https://groups.google.com/d/optout.

Mark Drew wrote on 2016-03-11:

web development - Why doesn't HTTP have POST redirect? - Software Engineering Stack Exchange
ve-post-redirect "Note that according to the W3.org http://w3.org
spec, when the METHOD is not HEAD or GET, user agents should prompt the
user before re-executing the request at the new location. You should
also provide a note and a fallback mechanism for the user in case old
user agents aren’t sure what to do with a 307.”
Sounds like expected behaviour. That’s why you get a “do you want to
re-submit this form” when you press reload.

My use case is/was a login to a site, and grabbing the resulting page. But a plain redirect wouldn’t work anyways, unless cfhttp would forward/set the cookie that is set in the request.

I was thinking that the redirect would be a GET request, and user agents (i.e. browsers) doesn’t prompt for a typical “submit login form”>“redirect to [intra/extra]net” (but also a cookie set in the process).

Cheers,
Hugo> On 11 Mar 2016, at 16:49, Geoff Parkhurst <@Geoff_Parkhurst mailto:Geoff_Parkhurst > wrote:

What’s the returned status code of that bitly link if you POST?

On 11 March 2016 at 10:46, Hugo Ahlenius <@Hugo_Ahlenius mailto:Hugo_Ahlenius > wrote:

  Hi,

  I just submitted this to the tracker -
  https://luceeserver.atlassian.net/browse/LDEV-781

  In 4.5.2.018 there is a bug where cfhttp does not

redirect if the method is
post. A simple test case:

  <h1>Trying with method=GET</h1>
  <cfhttp
         url='http://bit.ly/1LWdyrv'
         redirect='true'
         method='get'
  />
  <cfdump var="#cfhttp#" />

  <h1>Trying with method=POST</h1>
  <cfhttp
         url='http://bit.ly/1LWdyrv'
         redirect='true'
         method='post'
  />
  <cfdump var="#cfhttp#" />


  Regards,
  Hugo

  --
  Hugo Ahlenius
  @Hugo_Ahlenius



  -- 		Love Lucee? Become a supporter and be part of the Lucee project

today! - http://lucee.org/supporters/become-a-supporter.html — You
received this message because you are subscribed to the Google Groups
“Lucee” group. To unsubscribe from this group and stop receiving
emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com. To view
this discussion on the web visit
https://groups.google.com/d/msgid/lucee/09ad01d17b83%243c6306b0%24b52914
10%24%40oxel.net. For more options, visit
https://groups.google.com/d/optout.

– Love Lucee? Become a supporter and be part of the Lucee project
today! - http://lucee.org/supporters/become-a-supporter.html — You
received this message because you are subscribed to the Google Groups
“Lucee” group. To unsubscribe from this group and stop receiving emails
from it, send an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com . To post to this group,
send email to lucee@googlegroups.com mailto:lucee@googlegroups.com .
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/CAC0HRKmKahJ7wc30PZNs62cJGXVA_pW
HVmAZYaPD9RfzSQA6Og%40mail.gmail.com. For more options, visit
https://groups.google.com/d/optout.