feat: gitlab feature
This commit is contained in:
parent
5fc65c7636
commit
d54ef5f265
3 changed files with 6 additions and 3 deletions
|
|
@ -14,11 +14,12 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
mod forgejo;
|
||||
#[cfg(feature = "gitlab")]
|
||||
mod gitlab;
|
||||
mod types;
|
||||
|
||||
pub use crate::hooks::forgejo::ForgejoHook;
|
||||
#[allow(deprecated)]
|
||||
#[cfg(feature = "gitlab")]
|
||||
pub use crate::hooks::gitlab::GitlabHook;
|
||||
pub use crate::hooks::types::Hook;
|
||||
pub use crate::hooks::types::{IssueAction, MergeRequestAction, WikiAction};
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::error::Error;
|
||||
#[allow(deprecated)]
|
||||
#[cfg(feature = "gitlab")]
|
||||
use crate::hooks::GitlabHook;
|
||||
use crate::hooks::{ForgejoHook, Hook};
|
||||
|
||||
|
|
@ -62,6 +62,7 @@ async fn hooks_inner(req: Request<Incoming>, secret: &str) -> Result<Hook, Error
|
|||
let whole_body = req.collect().await?.aggregate();
|
||||
whole_body.reader().read_to_end(&mut payload)?;
|
||||
|
||||
#[cfg(feature = "gitlab")]
|
||||
if let Some(val) = headers.get("X-Gitlab-Token") {
|
||||
if secret != val {
|
||||
return Err(Error::InvalidSecret);
|
||||
|
|
|
|||
Loading…
Reference in a new issue