mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Adding method for doing browser redirection from inside any route.
Made some small changes
This commit is contained in:
parent
d25a611fbd
commit
cd69a866d5
3 changed files with 27 additions and 0 deletions
|
@ -22,6 +22,11 @@ class Kemal::Context
|
|||
@response.content_type
|
||||
end
|
||||
|
||||
def redirect(url)
|
||||
@response.headers.add "Location", url
|
||||
@response.status_code = 301
|
||||
end
|
||||
|
||||
delegate headers, @request
|
||||
delegate status_code, @response
|
||||
delegate :"status_code=", @response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue