Add haltf method to halt current route context

This commit is contained in:
syeopite 2021-08-14 00:27:41 -07:00
parent abca5c6829
commit a9fa46b60e
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82

View File

@ -56,3 +56,12 @@ end
macro rendered(filename)
render "src/invidious/views/#{{{filename}}}.ecr"
end
# Similar to Kemals halt method but works in a
# method.
macro haltf(env, status_code = 200, response = "")
{{env}}.response.status_code = {{status_code}}
{{env}}.response.print {{response}}
{{env}}.response.close
return
end