Method: Chef::Provider::RemoteFile::HTTP#conditional_get_headers

Defined in:
lib/chef/provider/remote_file/http.rb

#conditional_get_headersObject



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/chef/provider/remote_file/http.rb', line 51

def conditional_get_headers
  cache_control_headers = {}
  if (last_modified = cache_control_data.mtime) && want_mtime_cache_control?
    cache_control_headers["if-modified-since"] = last_modified
  end
  if (etag = cache_control_data.etag) && want_etag_cache_control?
    cache_control_headers["if-none-match"] = etag
  end
  logger.trace("Cache control headers: #{cache_control_headers.inspect}")
  cache_control_headers
end