haxetink / tink_web

Tinkerbell Web Framework
https://haxetink.github.io/tink_web
43 stars 14 forks source link

@:header not sent when route type is `Noise` or `Promise<Noise>` #114

Closed grepsuzette closed 4 years ago

grepsuzette commented 4 years ago

@:get('/test1') @:header("foo", "bar") public function test1() return Noise; Server never sends a "foo" header in the response.

@:get('/test1') @:header("foo", "bar") public function test1() return "OK"; Works.

It seems to not work when the route return type is Noise or Promise<Noise>.

Arguably Noise on a GET method doesn't make sense but it's the same on a DELETE one.

kevinresol commented 4 years ago

I think we need to add the handling here: https://github.com/haxetink/tink_web/blob/356369e5bdfd9ac6193b279e5555546ba6d6724f/src/tink/web/macros/Routing.hx#L379-L384