Uploaded image for project: 'Maven Wagon'
  1. Maven Wagon
  2. WAGON-476

HTTP Provider follows redirects on PUT and may change request method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11
    • Fix Version/s: 2.12
    • Component/s: wagon-http
    • Labels:
      None
    • Flags:
      Important

      Description

      By default HttpClient follows redirects with DefaultRedirectStrategy when nothing is configured or redirects aren't explicitly disabled. While this is fine for HEAD or GET, this causes errors at runtime and in tests for PUT requests. AbstractHttpClientWagon#put() handles redirects manually, but they never arrive there because the client automatically follows them and may – dependend on the status code – change request method, resulting in Not Found and not a re-PUT.

      HttpClient-side redirect handling must be disabled for PUT requests and handled with the given code.

        Issue Links

          Activity

          Hide
          michael-o Michael Osipov added a comment -

          This issue has been found during WAGON-474.

          Show
          michael-o Michael Osipov added a comment - This issue has been found during WAGON-474 .
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-wagon #1330 (See https://builds.apache.org/job/maven-wagon/1330/)
          WAGON-476 HTTP Provider follows redirects on PUT and may change (michaelo: http://git-wip-us.apache.org/repos/asf/?p=maven-wagon.git&a=commit&h=6cc8d907f40b82a0500d700bcd0ea8075736a6bc)

          • (edit) wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-wagon #1330 (See https://builds.apache.org/job/maven-wagon/1330/ ) WAGON-476 HTTP Provider follows redirects on PUT and may change (michaelo: http://git-wip-us.apache.org/repos/asf/?p=maven-wagon.git&a=commit&h=6cc8d907f40b82a0500d700bcd0ea8075736a6bc ) (edit) wagon-providers/wagon-http/src/main/java/org/apache/maven/wagon/providers/http/AbstractHttpClientWagon.java
          Hide
          michael-o Michael Osipov added a comment -
          Show
          michael-o Michael Osipov added a comment - Fixed with 6cc8d907f40b82a0500d700bcd0ea8075736a6bc .

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              michael-o Michael Osipov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development