mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-06 05:24:28 -04:00
Add haltf method to halt current route context
This commit is contained in:
parent
abca5c6829
commit
a9fa46b60e
1 changed files with 9 additions and 0 deletions
|
@ -56,3 +56,12 @@ end
|
||||||
macro rendered(filename)
|
macro rendered(filename)
|
||||||
render "src/invidious/views/#{{{filename}}}.ecr"
|
render "src/invidious/views/#{{{filename}}}.ecr"
|
||||||
end
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue