-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhooks post X-Github-* should be X-GitHub-* #3304
Comments
I'll try to provide a patch for this once I'm setup unless this casing was intentional for some reason. Still studying gitea code-base. |
The code seems to have right casing: |
From go doc http.Request:
|
hmm I wonder how many tools abide by that rule. Since it's coming thru as a key-value store the casing is preserved when I query it and two terms have different keys. I assume any language that are case sensitive might have similar issue. Though if it's meant to be case sensitive anyway why does the http lib bother changing the case of input from what programmer specified? Seems like a needless exercise that just causes confusion. |
I think most the languages that have standard lib for header parsing have keys case insensitive |
Okay then it's probably not worth the bother fixing given it's so deeply embedded. |
Just closed this before I read this related ticket Would it be possible to use header key directly just for this GitHub thing that really should match what github is posting in their webhook? If that's agreeable I'll be happy to reopen this and test it out. |
For the sake of compatibility I'd try retaining the expected casing.
|
Headers are case insensitive, Jenkins is broken and should be fixed 🙄 4.2 => https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html |
beside Jenkins being or not broken, this issue is about the GitHub compatibility header being NOT THE SAME as the one sent by GitHub. If we want to comply let's comply |
I agree on the change. Though it might cause some breakage, users which depend on the casing have an underlying problem in their http lib, which is that of headers being case sensitive when they should be insensitive. On the plus side, we get API that is compatible with github. |
[x]
):Description
I setup a Jenkins generic web hook with hopes to handle both gitea and github pull requests and for the most part gitea can impersonate a github webhook.
However my webhook was looking for filter:
X-GitHub-Event
note the uppercase H this is because GitHub's pull requests have a header like this:
While Gitea outputs like this:
The h should be upper-cased to be consistent with how GitHub posts their web hooks
...
Screenshots
The text was updated successfully, but these errors were encountered: