def _handle_head(gs_stub, filename):
 filestat = gs_stub.head_object(filename)
 if (not filestat):
  return _FakeUrlFetchResult(404, {}, '')
 http_time = common.posix_time_to_http(filestat.st_ctime)
 response_headers = {'content-length': filestat.st_size, 'content-type': filestat.content_type, 'etag': filestat.etag, 'last-modified': http_time}
 if filestat.metadata:
  response_headers.update(filestat.metadata)
 return _FakeUrlFetchResult(200, response_headers, '')

def _handle_head ( gs_stub , filename ) : filestat = gs_stub . head_object ( filename ) if ( not filestat ) : return _FakeUrlFetchResult ( 404 , { } , '' ) http_time = common . posix_time_to_http ( filestat . st_ctime ) response_headers = { 'content-length' : filestat . st_size , 'content-type' : filestat . content_type , 'etag' : filestat . etag , 'last-modified' : http_time } if filestat . metadata : response_headers . update ( filestat . metadata ) return _FakeUrlFetchResult ( 200 , response_headers , '' )
handle head request .