def service(self):
    if self.request.url.path[-4:] == '.jpg':
      path = os.path.abspath(self.request.url.path.replace('..', '').lstrip('/'))
      sys.stderr.write("Sending file %s\n" % path)
      self.response.send_file(path)
    else:
      self.response.headers = ["Content-Type: text/html"]
      self.response.write("An image which will be sent using X-Sendfile if supported:<br/>")
      self.response.write('<img src="image.jpg" alt="" />')
dataset/ETHPy150Open rsms/smisk/examples/core/sendfile/process.py/MyApp.service/original