Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17185

Trailing slash shouldn't be required for webhook url

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • github v1.5, Jenkins ver. 1.505

      This wasn't manifesting in the browser, as my browser was automatically prefixing the url with a slash, but I finally confirmed it with plain ol curl

      `curl http://ci.example.com/github-webhook/`

      • result: same error about payload that you see in the browser

      `curl curl http://ci.example.com/github-webhook`

      • result: silence. no output.

      I spent like 2 hours trying to figure this out, but mostly because I didn't realize that the github service "Update settings" button needed to be pushed before "Test Hook" would work. But that's an issue for github

          [JENKINS-17185] Trailing slash shouldn't be required for webhook url

          James Talmage added a comment -

          This still appears to be an issue.
          I experienced it with the Bitbucket plugin.

          `http://server/bitbucket-hook` vs `http://server/bitbucket-hook/`

          I checked the code for the Bitbucket plugin, and it does not appear that the problem lies there. As it doesn't appear they control URL matching.

          I think this belongs in core.

          James Talmage added a comment - This still appears to be an issue. I experienced it with the Bitbucket plugin. ` http://server/bitbucket-hook ` vs ` http://server/bitbucket-hook/ ` I checked the code for the Bitbucket plugin, and it does not appear that the problem lies there. As it doesn't appear they control URL matching . I think this belongs in core.

          Daniel Beck added a comment - - edited

          `curl curl http://ci.example.com/github-webhook`

          • result: silence. no output.

          Is there no Location header redirecting to the expected URL?

          Update: There is.

          $ curl -i https://jenkins/github-webhook
          HTTP/1.1 302 Moved Temporarily
          …
          Location: https://jenkins/github-webhook/
          …
          Content-Length: 0
          Connection: keep-alive

          So what's the problem here? Took me about a minute to figure this out.

          Daniel Beck added a comment - - edited `curl curl http://ci.example.com/github-webhook ` result: silence. no output. Is there no Location header redirecting to the expected URL? Update: There is. $ curl -i https: //jenkins/github-webhook HTTP/1.1 302 Moved Temporarily … Location: https: //jenkins/github-webhook/ … Content-Length: 0 Connection: keep-alive So what's the problem here? Took me about a minute to figure this out.

          Daniel Beck added a comment -

          This behavior in Stapler is deliberate, and changing it would result in lots of brokenness:
          https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/Stapler.java#L715

          Daniel Beck added a comment - This behavior in Stapler is deliberate, and changing it would result in lots of brokenness: https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/Stapler.java#L715

            Unassigned Unassigned
            patcon Patrick Connolly
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: