Motivation
Before you GET the URL U1, you may need to GET another URL U2.
Description and Documentation
The new parameter
preflight will be introduced to INCLUDE.
The HTTP user agent will GET the preflight URL before the HTTP user agent GET the URL to be included.
This way, the user agent gets ready for the task of inclusion.
For this to be useful, most likely, {LWPUserAgent}{Params}{cookie_jar} needs to be true.
This implies that
TWiki::Net::_requestUsingLWP() will be enhanced.
_requestUsingLWP() is indirectly called from both
TWiki::Net::getExternalResource() and
TWiki::Net::postExternalResource().
A preflight access can be crucial for a POST access.
There are cases where a GET request is authenticated in the course of redirects.
To POST to the same server, you need to send a GET request before it because a POST request is not subject to redirects.
As such, this is not only about the INCLUDE tag, but also to make
TWiki::Net::getExternaResource() and
TWiki::Net::postExternaResource() preflight capable.
By which plugins using
TWiki::Func::getExternalResource() and/or
TWiki::Func::postExternalResource() can be made preflight capable.
There can be a situation where you don't want to allow preflight access.
{HTTP}{EnablePreflight} boolean configuration parameter (set $TRUE in TWiki.spec) will control the availability.
Examples
%INCLUDE{"https://example.com/retrieve?abc=123&def=456" preflight="https:/example.com"}%
Impact
Implementation
--
Contributors:
Hideyo Imazu - 2020-05-25
Discussion
Sounds good. Small typo on
reflight vs
preflight parameter.
--
Peter Thoeny - 2020-05-25
Thank you for pointing it out. And I elaborated more.
--
Hideyo Imazu - 2020-05-26