ensure forward slash

This commit is contained in:
Kyle Drake 2015-07-03 16:09:42 -07:00
parent a5fdbfe4a7
commit bb44965c8e
2 changed files with 12 additions and 0 deletions

View file

@ -10,6 +10,9 @@ class PurgeCacheWorker
end
def perform(proxy_ip, username, path)
# Must always have a forward slash
path = '/' + path if path[0] != '/'
url = Addressable::URI.encode_component(
"http://#{proxy_ip}/:cache/purge#{path}",
Addressable::URI::CharacterClasses::QUERY