File: escape_path.rb

package info (click to toggle)
ruby-excon 0.112.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 7,855; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true
module Excon
  module Middleware
    class EscapePath < Excon::Middleware::Base
      def request_call(datum)
        # make sure path is encoded, prevent double encoding
        datum[:path] = Excon::Utils.escape_uri(Excon::Utils.unescape_uri(datum[:path]))
        @stack.request_call(datum)
      end
    end
  end
end