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 "xml"
require "yaml"
require "./cookie_fix"
require "./helpers"
require "./invidious/*"
CONFIG = Config.from_yaml(File.read("config/config.yml"))

View File

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