lib/vault-tools/web.rb in vault-tools-0.5.14 vs lib/vault-tools/web.rb in vault-tools-0.5.15

- old
+ new

@@ -17,10 +17,18 @@ # protect! is used %w{get put post delete head options path link unlink}.each do |meth| define_method "#{meth}_unprotected".to_sym do |path, opts = {}, &block| pattern = compile!(meth.upcase, path, block, opts).first set :unprotected_paths, settings.unprotected_paths + [pattern] - route meth.upcase, path, opts, &block + if meth.downcase == 'get' + conditions = @conditions.dup + route 'GET', path, opts, &block + + @conditions = conditions + route 'HEAD', path, opts, &block + else + route meth.upcase, path, opts, &block + end end end end # HTTP Basic Auth Support