Fix a bug where searching in web app using iOS causes page to reload (#645)
* Fix a bug where searching in web app using iOS causes page to reload * Add cors handler in prod
This commit is contained in:
1 parent
06326d084e
commit
58e2b48409
4 files changed
+84
-67
No files matched your search
@@ -20,9 +20,17 @@ namespace Http
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
response.headers["Access-Control-Allow-Origin"] = m.origin
|
||||
response.headers["Access-Control-Allow-Headers"] = m.headers
|
||||
response.headers["Access-Control-Allow-Methods"] = m.methods
|
||||
if not StringUtils.IsNullOrEmpty(m.origin)
|
||||
response.headers["Access-Control-Allow-Origin"] = m.origin
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(m.headers)
|
||||
response.headers["Access-Control-Allow-Headers"] = m.headers
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(m.methods)
|
||||
response.headers["Access-Control-Allow-Methods"] = m.methods
|
||||
end if
|
||||
|
||||
if request.method = "OPTIONS"
|
||||
response.header_only = true
|
||||
|
||||
Reference in new issue
Block a user