mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 14:03:37 +00:00
Remove patch and update file structure
This commit is contained in:
parent
a789114f43
commit
eb1df96e1b
@ -1,29 +0,0 @@
|
||||
# See https://github.com/crystal-lang/crystal/pull/5408
|
||||
module HTTP
|
||||
class Cookie
|
||||
module Parser
|
||||
SetCookieStringFix = /^#{Regex::CookiePair}(?:;\s*#{Regex::CookieAV})*$/
|
||||
|
||||
def parse_set_cookie(header)
|
||||
match = header.match(SetCookieStringFix)
|
||||
return unless match
|
||||
|
||||
expires = if max_age = match["max_age"]?
|
||||
Time.now + max_age.to_i.seconds
|
||||
else
|
||||
parse_time(match["expires"]?)
|
||||
end
|
||||
|
||||
Cookie.new(
|
||||
match["name"], match["value"],
|
||||
path: match["path"]? || "/",
|
||||
expires: expires,
|
||||
domain: match["domain"]?,
|
||||
secure: match["secure"]? != nil,
|
||||
http_only: match["http_only"]? != nil,
|
||||
extension: match["extension"]?
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -20,8 +20,7 @@ require "option_parser"
|
||||
require "pg"
|
||||
require "xml"
|
||||
require "yaml"
|
||||
require "./cookie_fix"
|
||||
require "./helpers"
|
||||
require "./invidious/*"
|
||||
|
||||
CONFIG = Config.from_yaml(File.read("config/config.yml"))
|
||||
|
||||
|
@ -10,11 +10,11 @@ macro add_mapping(mapping)
|
||||
end
|
||||
|
||||
macro templated(filename)
|
||||
render "src/views/#{{{filename}}}.ecr", "src/views/layout.ecr"
|
||||
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/layout.ecr"
|
||||
end
|
||||
|
||||
macro rendered(filename)
|
||||
render "src/views/#{{{filename}}}.ecr"
|
||||
render "src/invidious/views/#{{{filename}}}.ecr"
|
||||
end
|
||||
|
||||
class Config
|
Loading…
Reference in New Issue
Block a user