An unofficial, mostly Bitwarden-compatible API server written in Ruby (Sinatra and ActiveRecord)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

mitm: support OPTIONS requests

+15
+15
tools/mitm.rb
··· 76 76 proxy_to upstream_url_for(request.path_info), :put 77 77 end 78 78 79 + options /(.*)/ do 80 + proxy_to upstream_url_for(request.path_info), :options 81 + end 82 + 79 83 def proxy_to(url, method) 84 + if RAW_QUERIES 85 + puts "#{request.env["REQUEST_METHOD"]} request to #{request.path_info}:" 86 + request.env.each do |k,v| 87 + if k.match(/^[A-Z_]+$/) 88 + puts " #{k}: #{v}" 89 + end 90 + end 91 + end 92 + 80 93 puts "proxying #{method.to_s.upcase} to #{url}" 81 94 82 95 uri = URI.parse(url) ··· 121 134 res = h.put(uri.path, post_data, send_headers) 122 135 when :delete 123 136 res = h.delete(uri.path, send_headers) 137 + when :options 138 + res = h.options(uri.path, send_headers) 124 139 else 125 140 raise "unknown method type #{method.inspect}" 126 141 end