From dce0937e2ea96bb5692c2d10b845abac8797220a Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sat, 11 Nov 2023 20:42:48 +0400 Subject: [PATCH] bumped version --- .gitignore | 1 + landline.gemspec | 2 +- lib/landline.rb | 2 +- lib/landline/dsl/methods_path.rb | 4 ++-- lib/landline/util/cookie.rb | 7 +++++++ lib/landline/util/parseutils.rb | 4 +++- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e15841d..dd5a364 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /*.gem /doc /.yardoc +/examples/uploader/files/* diff --git a/landline.gemspec b/landline.gemspec index 752b621..b44afe2 100644 --- a/landline.gemspec +++ b/landline.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "landline" - spec.version = "0.10.0" + spec.version = "0.11.0" spec.summary = "Elegant HTTP DSL" spec.description = <<~DESC Landline is a no-hard-dependencies HTTP routing DSL that was made entirely for fun. diff --git a/lib/landline.rb b/lib/landline.rb index 86345ab..499e712 100644 --- a/lib/landline.rb +++ b/lib/landline.rb @@ -10,7 +10,7 @@ require_relative 'landline/template' # Landline is a hideously simple ruby web framework module Landline # Landline version - VERSION = '0.10 "Node graph out of date. Rebuilding..." (beta)' + VERSION = '0.11 "Decades of science" (beta)' # Landline branding and version VLINE = "Landline/#{Landline::VERSION} (Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})\n".freeze diff --git a/lib/landline/dsl/methods_path.rb b/lib/landline/dsl/methods_path.rb index 8412455..2e0becd 100644 --- a/lib/landline/dsl/methods_path.rb +++ b/lib/landline/dsl/methods_path.rb @@ -42,13 +42,13 @@ module Landline # Set root path (appends matched part of the path). # @param path [String] def root(path) - @origin.root = path + @origin.root = File.expand_path(path) end # Set root path (without appending matched part). # @param path [String] def remap(path) - @origin.remap = path + @origin.remap = File.expand_path(path) end # Add a preprocessor to the path. diff --git a/lib/landline/util/cookie.rb b/lib/landline/util/cookie.rb index e83ef3e..53333ae 100644 --- a/lib/landline/util/cookie.rb +++ b/lib/landline/util/cookie.rb @@ -4,9 +4,16 @@ require_relative 'parseutils' require_relative 'errors' require 'date' require 'openssl' +require 'base64' HeaderRegexp = Landline::Util::HeaderRegexp ParserCommon = Landline::Util::ParserCommon +if RUBY_ENGINE == 'jruby' # fix for JRuby + OpenSSL::HMAC.define_singleton_method(:base64digest) do |*args| + Base64.encode64(OpenSSL::HMAC.digest(*args)).strip + end +end + module Landline # Utility class for handling cookies class Cookie diff --git a/lib/landline/util/parseutils.rb b/lib/landline/util/parseutils.rb index 86eebe8..9b8d2eb 100644 --- a/lib/landline/util/parseutils.rb +++ b/lib/landline/util/parseutils.rb @@ -48,7 +48,9 @@ module Landline # @param regexp [Regexp,nil] override param matching regexp # @return [Array(String, Hash)] def self.parse_value(input, sep: ";", unquote: false, regexp: nil) - parts = input.split(sep).map { |x| URI.decode_uri_component(x).strip } + parts = input.split(sep).map do |x| + URI.decode_www_form_component(x).strip + end base = parts.shift opts = parts.map do |raw| key, value = raw.match(if regexp