16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/greed/cookie/path_handler.rb', line 16
def determine_path(document_path, cookie_path)
return generate_default_path(document_path) if cookie_path.blank?
if cookie_path == ?/
return {
path: ?/,
}
end
normalized_cookie_path = ::File.expand_path(?., cookie_path)
iterate_cookie_path(document_path).each do |path_candidate|
next unless path_candidate == normalized_cookie_path
return {
path: normalized_cookie_path,
}
end
raise PathViolation
end
|