Skip to content

Commit 0e71acf

Browse files
committed
fix: correct function signature
1 parent 81d76b7 commit 0e71acf

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

  • crates/taurus-core/src/runtime/functions

crates/taurus-core/src/runtime/functions/http.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@ fn respond(
3333
_ctx: &mut ValueStore,
3434
_run: &mut crate::handler::registry::ThunkRunner<'_>,
3535
) -> Signal {
36-
args!(args => http_status_code: i64, headers: Struct, _http_schema: String, payload: Value);
36+
args!(args => http_status_code: i64, http_schema: String, payload: Value, headers: Value);
37+
38+
let http_headers = match headers_from_value(&headers) {
39+
Ok(headers) => headers,
40+
Err(signal) => return signal,
41+
};
3742

3843
let mut fields = HashMap::new();
3944
fields.insert("http_status_code".to_string(), http_status_code.to_value());
40-
fields.insert(
41-
"headers".to_string(),
42-
Value {
43-
kind: Some(Kind::StructValue(headers)),
44-
},
45-
);
45+
fields.insert("headers".to_string(), Value {
46+
kind: Some(Kind::StructValue(http_headers))
47+
});
48+
4649
fields.insert("payload".to_string(), payload);
50+
fields.insert("http_schema".to_string(), http_schema.to_value());
4751

4852
// `Respond` is a control signal; the executor can still continue with `next` if present.
4953
Signal::Respond(Value {

0 commit comments

Comments
 (0)