4 positive_expire_secs = 60*60
5 negative_expire_secs = 60*5;
8 response_body =
'Bad Request: ' + reason +
"\n"
9 start_response(
'400 Bad Request',
10 [(
'Cache-control',
'max-age=' + str(negative_expire_secs)),
11 (
'Content-Length', str(len(response_body)))])
12 return [response_body.encode(
'utf-8')]
15 start_response(
'200 OK',
16 [(
'Content-Type',
'text/plain'),
17 (
'Cache-control',
'max-age=' + str(positive_expire_secs)),
18 (
'Content-Length', str(len(response_body)))])
19 return [response_body.encode(
'utf-8')]
21 def dispatch(api_func, path_info, repo_name, version, start_response, environ):
23 return cvmfs_geo.api(path_info, repo_name, version, start_response, environ)
25 return bad_request(start_response,
'unrecognized api function')