xpl processor submission not handling redirects

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

xpl processor submission not handling redirects

ldeck
Hi there,

I have a pipeline wherein one of the processors aggregates some data and performs a POST.

However, if the post is to HTTP and a 302 is returned to the HTTPS equivalent url, this appears not to be handled at all.

Now I can put in a kludge --- {replace(//ServiceURI, 'http:', 'https:')  but it would be good if there was a property that I can just set somewhere to handle these automatically when encountered.
Does such a property exist?

cheers,
Lachlan

<p:processor name="oxf:xslt">
                <p:input name="data" href="aggregate('root', #params, #env)"/>
                <p:input name="config">
                        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                                <xsl:template match="/">
                                        <xforms:submission method="post"
                                                action="{//ServiceURI)}/foo/bar/service" />
                                </xsl:template>
                        </xsl:stylesheet>
                </p:input>
                <p:output name="data" id="submission-result" />
        </p:processor>

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: xpl processor submission not handling redirects

Alessandro  Vernet
Administrator
Hi Lachlan,

It's tricky to automatically re-do a POST to another URL if the original server answered with a 30x. In fact browsers don't do that for POSTs; they follow the redirect, but doing a GET, hence not resending the data to the new server.

So as you noticed, the xf:submission doesn't just follow redirects. In your case, why wouldn't you immediately do the submission to the correct URL? You're saying that you could do replace(//ServiceURI, 'http:', 'https:'. But why doesn't //ServiceURI contain the URL with https:// if this is the URL that must be used?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: xpl processor submission not handling redirects

ldeck
Yeah, good question.
I suppose it's only been useful for my debugging purposes being able to sniff what http traffic has been occurring; otherwise in production they should indeed configure the primary url.

It was just unusual as every other submission (which is usually a get) has handled the redirect. But as you say a post is a different story.
No worries.

On 12/10/2013, at 10:09 AM, Alessandro Vernet <[hidden email]> wrote:

> Hi Lachlan,
>
> It's tricky to automatically re-do a POST to another URL if the original
> server answered with a 30x. In fact browsers don't do that for POSTs; they
> follow the redirect, but doing a GET, hence not resending the data to the
> new server.
>
> So as you noticed, the xf:submission doesn't just follow redirects. In your
> case, why wouldn't you immediately do the submission to the correct URL?
> You're saying that you could do replace(//ServiceURI, 'http:', 'https:'. But
> why doesn't //ServiceURI contain the URL with https:// if this is the URL
> that must be used?
>
> Alex
>
> -----
> --
> Follow Orbeon on Twitter: @orbeon
> Follow me on Twitter: @avernet
> --
> View this message in context: http://discuss.orbeon.com/xpl-processor-submission-not-handling-redirects-tp4657425p4657442.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: xpl processor submission not handling redirects

Alessandro  Vernet
Administrator
ldeck wrote
Yeah, good question.
I suppose it's only been useful for my debugging purposes being able to sniff what http traffic has been occurring; otherwise in production they should indeed configure the primary url.
OK, got it; thanks for the update.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet