crhntr / muxt

Generate HTTP Endpoints from HTML Templates
MIT License
0 stars 0 forks source link

Conditionally write the header in execute #5

Closed crhntr closed 2 months ago

crhntr commented 2 months ago

Currently generated code may try to write the header multiple times.

The generated execute call should not call WriteHeader or mutate the Header when the handler receives the a ResponseWriter.

Given the static receiver has a non-string basic type And there is a template named GET / F(response) When muxt generate is invoked Then the generated function literal should not invoke execute and should just write the template bytes, if template execution fails do not write the response just return

crhntr commented 2 months ago

finished here: 155b1977289acb26a6ea34da3914e3a6b5c54962