[PR #2814] [MERGED] Fix API status code for hook creation #16607

Closed
opened 2025-11-02 12:14:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2814
Author: @ethantkoenig
Created: 11/1/2017
Status: Merged
Merged: 11/20/2017
Merged by: @lunny

Base: masterHead: fix/hook_api


📝 Commits (2)

  • f9df529 Fix API status code for hook creation
  • 6a01664 Named constants for response statuses

📊 Changes

3 files changed (+5 additions, -4 deletions)

View changed files

📝 public/swagger.v1.json (+1 -1)
📝 routers/api/v1/repo/hook.go (+1 -1)
📝 routers/api/v1/utils/hook.go (+3 -2)

📄 Description

Return 201, instead of 200, when creating a hook via the API; this is in compliance with the Github API, and more generally the semantics of HTTP status codes. Affects the following routes:

  • POST /:owner/:repo/hooks
  • POST /orgs/:org/hooks

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2814 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 11/1/2017 **Status:** ✅ Merged **Merged:** 11/20/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix/hook_api` --- ### 📝 Commits (2) - [`f9df529`](https://github.com/go-gitea/gitea/commit/f9df5295b33039c216bf470ab343dde9d0379b2f) Fix API status code for hook creation - [`6a01664`](https://github.com/go-gitea/gitea/commit/6a01664d1a20accdbfcf19d81c01b88cca190964) Named constants for response statuses ### 📊 Changes **3 files changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `public/swagger.v1.json` (+1 -1) 📝 `routers/api/v1/repo/hook.go` (+1 -1) 📝 `routers/api/v1/utils/hook.go` (+3 -2) </details> ### 📄 Description Return 201, instead of 200, when creating a hook via the API; this is in compliance with the Github API, and more generally the semantics of HTTP status codes. Affects the following routes: - `POST /:owner/:repo/hooks` - `POST /orgs/:org/hooks` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:14:32 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16607