class_docstr: Implements the POST /upload_file endpoint.
class_docstr_tok: ["Implements","the","POST","\/upload_file","endpoint","."]
code: def set_default_headers(self):
      self.set_header(
          "Access-Control-Allow-Methods", "PUT, OPTIONS, DELETE"
      )
      self.set_header("Access-Control-Allow-Headers", "Content-Type")
      if config.get_option("server.enableXsrfProtection"):
          self.set_header(
              "Access-Control-Allow-Origin",
              server_util.get_url(
                  config.get_option("browser.serverAddress")
              ),
          )
          self.set_header(
              "Access-Control-Allow-Headers",
              "X-Xsrftoken, Content-Type",
          )
          self.set_header("Vary", "Origin")
          self.set_header("Access-Control-Allow-Credentials", "true")
      elif routes.allow_cross_origin_requests():
          self.set_header("Access-Control-Allow-Origin", "*")
  
file_path: streamlit/lib/streamlit/web/server/upload_file_request_handler.py
imports: from typing import Any, Callable, Dict, List
  import tornado.httputil
  import tornado.web
  from streamlit import config
  from streamlit.logger import get_logger
  from streamlit.runtime.memory_uploaded_file_manager import MemoryUploadedFileManager
  from streamlit.runtime.uploaded_file_manager import UploadedFileManager, UploadedFileRec
  from streamlit.web.server import routes, server_util
label_desc: Use image node_id 2 for calling the UploadFileRequestHandler obj's underlying member method code with example usage: obj.set_default_headers() without return types