You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by stevegy <gi...@git.apache.org> on 2016/07/12 12:05:37 UTC

[GitHub] nutch pull request #134: fix the cookie policy issue in post form authentica...

GitHub user stevegy opened a pull request:

    https://github.com/apache/nutch/pull/134

    fix the cookie policy issue in post form authentication

    Fix the [NUTCH-2280](https://issues.apache.org/jira/browse/NUTCH-2280).
    When a HTTP post receives session cookie from server, it might hit an issue when the server has a domain name set as ".domain.com". The "." at beginning will cause HttpClient reject this cookie.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/stevegy/nutch NUTCH-2280

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nutch/pull/134.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #134
    
----
commit 993e997e2d5795c0623cdf5614d02c7a8ce405d5
Author: Steve Yao <st...@live.com>
Date:   2016-07-12T11:41:10Z

    fix the cookie policy issue when the form authentication receives session cookie in a non-standard format - NUTCH-2280

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #134: NUTCH-2280 fix the cookie policy issue in post form...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nutch/pull/134


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #134: NUTCH-2280 fix the cookie policy issue in post form...

Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/134#discussion_r70545476
  
    --- Diff: src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpFormAuthentication.java ---
    @@ -135,6 +143,26 @@ public boolean getFollowRedirects() {
           }
         }
       }
    +  
    +  /**
    +   * @throws NoSuchFieldException
    +   * @throws SecurityException
    +   * @throws IllegalArgumentException
    +   * @throws IllegalAccessException
    +   */
    +  private void setCookieParams(HttpFormAuthConfigurer formConfigurer,
    +		  HttpMethodParams params)
    +  		throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
    +  	// NUTCH-2280 - set the HttpClient cookie policy
    +        if (formConfigurer.getCookiePolicy() != null) {
    +      	  String policy = formConfigurer.getCookiePolicy();
    +      	  Object p = FieldUtils.readDeclaredStaticField(CookiePolicy.class, policy);
    +      	  if(null != p) {
    +      		  LOGGER.debug("reflection of cookie value: " + p.toString());
    --- End diff --
    
    Code formatting. 2 space indents please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #134: NUTCH-2280 fix the cookie policy issue in post form...

Posted by stevegy <gi...@git.apache.org>.
Github user stevegy commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/134#discussion_r70563336
  
    --- Diff: src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpFormAuthentication.java ---
    @@ -135,6 +143,26 @@ public boolean getFollowRedirects() {
           }
         }
       }
    +  
    +  /**
    +   * @throws NoSuchFieldException
    --- End diff --
    
    Sure. I have updated this source and re-pushed.
    And, add an updated httpclient-auth.xml.template for how to configure this cookie policy.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nutch pull request #134: NUTCH-2280 fix the cookie policy issue in post form...

Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:

    https://github.com/apache/nutch/pull/134#discussion_r70545560
  
    --- Diff: src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpFormAuthentication.java ---
    @@ -135,6 +143,26 @@ public boolean getFollowRedirects() {
           }
         }
       }
    +  
    +  /**
    +   * @throws NoSuchFieldException
    --- End diff --
    
    Substantiated Javadoc on all of the above would be preferable. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---