Remove patch and update file structure

This commit is contained in:
Omar Roth 2018-07-06 07:59:56 -05:00
parent a789114f43
commit eb1df96e1b
14 changed files with 3 additions and 33 deletions

View file

@ -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

View file

@ -20,8 +20,7 @@ require "option_parser"
require "pg" require "pg"
require "xml" require "xml"
require "yaml" require "yaml"
require "./cookie_fix" require "./invidious/*"
require "./helpers"
CONFIG = Config.from_yaml(File.read("config/config.yml")) CONFIG = Config.from_yaml(File.read("config/config.yml"))

View file

@ -10,11 +10,11 @@ macro add_mapping(mapping)
end end
macro templated(filename) macro templated(filename)
render "src/views/#{{{filename}}}.ecr", "src/views/layout.ecr" render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/layout.ecr"
end end
macro rendered(filename) macro rendered(filename)
render "src/views/#{{{filename}}}.ecr" render "src/invidious/views/#{{{filename}}}.ecr"
end end
class Config class Config