Files
rk35xx-android14/external/python/httplib2/test/conditional-updates/test.cgi
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

29 lines
695 B
Python
Executable File

#!/usr/bin/env python
import os
# Always returns an empty response body
# and adds in the X-Method: header with the
# method that was sent to the CGI
method = os.environ['REQUEST_METHOD']
if "GET" == method:
if "123456789" == os.environ.get('HTTP_IF_NONE_MATCH', ''):
print "Status: 304 Not Modified"
else:
print "Status: 200 Ok"
print "ETag: 123456789"
print ""
elif method in ["PUT", "PATCH", "DELETE"]:
if "123456789" == os.environ.get('HTTP_IF_MATCH', ''):
print "Status: 200 Ok"
print ""
else:
print "Status: 412 Precondition Failed"
print ""
else:
print "Status: 405 Method Not Allowed"
print ""