Skip to content

Commit

Permalink
feat: add support for text/plain webhook (windmill-labs#4146)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCasa authored Jul 29, 2024
1 parent 4f114cb commit eb6557a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/windmill-queue/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,14 @@ where
Error::BadRequest(format!("Cloud events batching is not supported yet"))
.into_response(),
)
} else if content_type.unwrap().starts_with("text/plain") {
let bytes = Bytes::from_request(req, _state)
.await
.map_err(IntoResponse::into_response)?;
let str = String::from_utf8(bytes.to_vec())
.map_err(|e| Error::BadRequest(format!("invalid utf8: {}", e)).into_response())?;
extra.insert("raw_string".to_string(), to_raw_value(&str));
Ok(PushArgsOwned { extra: Some(extra), args: HashMap::new() })
} else if content_type
.unwrap()
.starts_with("application/x-www-form-urlencoded")
Expand Down

0 comments on commit eb6557a

Please sign in to comment.