Commit 420a6adb by aagusti

perbaikan headers

1 parent 3866dc3f
......@@ -95,7 +95,6 @@ def add_cors_headers_response_callback(event):
headers = {
'Access-Control-Allow-Methods': 'POST,GET,DELETE,PUT,OPTIONS',
'Access-Control-Allow-Headers': 'Origin, Content-Type, Accept, Authorization',
# 'Access-Control-Allow-Credentials': 'true',
'Access-Control-Max-Age': '1728000',
}
log.info(f"{origin} {request.is_xhr}")
......@@ -107,6 +106,8 @@ def add_cors_headers_response_callback(event):
headers['Access-Control-Allow-Origin'] = origin
else:
headers['Access-Control-Allow-Origin'] = "*"
if 'Access-Control-Allow-Credentials' not in headers:
headers['Access-Control-Allow-Credentials'] = 'true'
log.info(f"Headers: {headers}")
response.headers.update(headers)
......
......@@ -47,9 +47,11 @@ class AddSchema(colander.Schema):
validator=colander.Length(max=32), oid="kode")
nama = colander.SchemaNode(colander.String(), oid="nama")
valu = colander.SchemaNode(colander.String(), oid="valu",
title="Action")
title="Action",
missing=colander.drop)
meth = colander.SchemaNode(colander.String(), oid="meth",
title="Method")
title="Method",
missing=colander.drop)
page_typ = colander.SchemaNode(colander.String(), oid="page_typ",
title="Page Type")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!