[ 
https://issues.apache.org/jira/browse/NIFI-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15325859#comment-15325859
 ] 

ASF GitHub Bot commented on NIFI-1937:
--------------------------------------

Github user mosermw commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/479#discussion_r66706057
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java
 ---
    @@ -197,6 +198,30 @@
                 .addValidator(StandardValidators.PORT_VALIDATOR)
                 .build();
     
    +    public static final String DEFAULT_COOKIE_POLICY_STR = "default";
    +    public static final String STANDARD_COOKIE_POLICY_STR = "standard";
    +    public static final String STRICT_COOKIE_POLICY_STR = "strict";
    +    public static final String NETSCAPE_COOKIE_POLICY_STR = "netscape";
    +    public static final String IGNORE_COOKIE_POLICY_STR = "ignore";
    +    public static final AllowableValue DEFAULT_COOKIE_POLICY = new 
AllowableValue(DEFAULT_COOKIE_POLICY_STR, DEFAULT_COOKIE_POLICY_STR,
    +            "Default cookie policy that provides a higher degree of 
compatibility with common cookie management of popular HTTP agents for 
non-standard (Netscape style) cookies.");
    +    public static final AllowableValue STANDARD_COOKIE_POLICY = new 
AllowableValue(STANDARD_COOKIE_POLICY_STR, STANDARD_COOKIE_POLICY_STR,
    +            "RFC 6265 compliant cookie policy (interoperability 
profile).");
    +    public static final AllowableValue STRICT_COOKIE_POLICY = new 
AllowableValue(STRICT_COOKIE_POLICY_STR, STRICT_COOKIE_POLICY_STR,
    +            "RFC 6265 compliant cookie policy (strict profile).");
    +    public static final AllowableValue NETSCAPE_COOKIE_POLICY = new 
AllowableValue(NETSCAPE_COOKIE_POLICY_STR, NETSCAPE_COOKIE_POLICY_STR,
    +            "Netscape draft compliant cookie policy.");
    +    public static final AllowableValue IGNORE_COOKIE_POLICY = new 
AllowableValue(IGNORE_COOKIE_POLICY_STR, IGNORE_COOKIE_POLICY_STR,
    +            "A cookie policy that ignores cookies.");
    +
    +    public static final PropertyDescriptor REDIRECT_COOKIE_POLICY = new 
PropertyDescriptor.Builder()
    +            .name("redirect-cookie-policy")
    +            .displayName("Redirect Cookie Policy")
    +            .description("When a HTTP server responds to a request with a 
redirect, this is the cookie policy used to copy cookies to the following 
request.")
    +            .allowableValues(DEFAULT_COOKIE_POLICY, 
STANDARD_COOKIE_POLICY, STRICT_COOKIE_POLICY, NETSCAPE_COOKIE_POLICY, 
IGNORE_COOKIE_POLICY)
    +            .defaultValue(DEFAULT_COOKIE_POLICY_STR)
    --- End diff --
    
    @trkurc thanks for reviewing.  Before version 0.6.0 we didn't specify a 
cookie spec, so it was DEFAULT.  I made a change in 0.6.0 to use 
CookieSpecs.STANDARD, thinking this just increased compatibility with more web 
sites.  When I found that was not true, I suggested via this PR that we make 
the CookieSpecs configurable in the processor.  So using 
.defaultValue(DEFAULT_COOKIE_POLICY_STR) here takes us back to the default 
value pre 0.6.0.
    
    I was hoping that it's rare that a cookie policy matters at all to GetHTTP, 
so taking us back to pre 0.6.0 functionality, by default, would be OK if not 
the desired functionality.


> GetHTTP should support configurable cookie policy
> -------------------------------------------------
>
>                 Key: NIFI-1937
>                 URL: https://issues.apache.org/jira/browse/NIFI-1937
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 0.6.1
>            Reporter: Michael Moser
>            Assignee: Michael Moser
>            Priority: Minor
>             Fix For: 1.0.0, 0.7.0
>
>
> After changes to GetHTTP in NIFI-1714, I found a corporate web site where 
> GetHTTP fails to download content.  GetHTTP could successfully download 
> content from this site before NIFI-1714 was implemented.  So that change 
> effectively broke access to this site.
> I propose we add a new property to GetHTTP that allows the NiFi user to 
> choose the HTTPClient (Apache HTTPComponents) cookie policy.  The property 
> would be called Redirect Cookie Policy which would be "When a HTTP server 
> responds to a request with a redirect, this is the cookie specification used 
> to copy cookies to the following request"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to