15: def select_terminus(request)
16:
17:
18:
19: return PROTOCOL_MAP["file"] if request.key =~ /^#{::File::SEPARATOR}/
20: return PROTOCOL_MAP["file"] if request.protocol == "file"
21:
22:
23: if request.protocol == "puppet" and (request.server or Puppet.settings[:name] != "puppet")
24: return PROTOCOL_MAP["puppet"]
25: end
26:
27: if request.protocol and PROTOCOL_MAP[request.protocol].nil?
28: raise(ArgumentError, "URI protocol '%s' is not currently supported for file serving" % request.protocol)
29: end
30:
31:
32: return :file_server
33: end