component file sharing: added Access-Control-Expose-Headers CORS header:
without this header, the range header in response was not exposed to client. This could cause trouble is a javascript application was needing to access it.
This commit is contained in:
parent
db286b98e4
commit
937a1db89f
1 changed files with 8 additions and 1 deletions
|
|
@ -115,8 +115,15 @@ class HTTPFileServer(resource.Resource):
|
|||
def render(self, request):
|
||||
request.setHeader("Access-Control-Allow-Origin", "*")
|
||||
request.setHeader("Access-Control-Allow-Methods", "OPTIONS, HEAD, GET, PUT")
|
||||
request.setHeader("Access-Control-Allow-Headers", "Content-Type, Xmpp-File-Path, Xmpp-File-No-Http")
|
||||
request.setHeader(
|
||||
"Access-Control-Allow-Headers",
|
||||
"Content-Type, Range, Xmpp-File-Path, Xmpp-File-No-Http")
|
||||
request.setHeader("Access-Control-Allow-Credentials", "true")
|
||||
request.setHeader("Accept-Ranges", "bytes")
|
||||
|
||||
request.setHeader(
|
||||
"Access-Control-Expose-Headers",
|
||||
"Date, Content-Length, Content-Range")
|
||||
return super().render(request)
|
||||
|
||||
def render_OPTIONS(self, request):
|
||||
|
|
|
|||
Loading…
Reference in a new issue