pkulchenko / fullmoon

Fast and minimalistic Redbean-based Lua web framework in one file.
MIT License
684 stars 30 forks source link

serveRedirect parameter order #16

Closed ghost closed 1 year ago

ghost commented 1 year ago

The other two serve* functions that take a status put it as the first argument while serveRedirect puts it last. Is there any interest in changing to serveRedirect(status, loc) or putting status last for the other two?

pkulchenko commented 1 year ago

That's interesting. The main reason for the re-ordering was that the status code is optional for the redirect, but I also made it optional for serveResponse too. I'm considering changing the order, but still accepting the current one. Thank you for the suggestion!