Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 420a6adb
authored
Dec 29, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan headers
1 parent
3866dc3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
opensipkd/base/__init__.py
opensipkd/base/views/menus.py
opensipkd/base/__init__.py
View file @
420a6ad
...
@@ -95,7 +95,6 @@ def add_cors_headers_response_callback(event):
...
@@ -95,7 +95,6 @@ def add_cors_headers_response_callback(event):
headers
=
{
headers
=
{
'Access-Control-Allow-Methods'
:
'POST,GET,DELETE,PUT,OPTIONS'
,
'Access-Control-Allow-Methods'
:
'POST,GET,DELETE,PUT,OPTIONS'
,
'Access-Control-Allow-Headers'
:
'Origin, Content-Type, Accept, Authorization'
,
'Access-Control-Allow-Headers'
:
'Origin, Content-Type, Accept, Authorization'
,
# 'Access-Control-Allow-Credentials': 'true',
'Access-Control-Max-Age'
:
'1728000'
,
'Access-Control-Max-Age'
:
'1728000'
,
}
}
log
.
info
(
f
"{origin} {request.is_xhr}"
)
log
.
info
(
f
"{origin} {request.is_xhr}"
)
...
@@ -107,6 +106,8 @@ def add_cors_headers_response_callback(event):
...
@@ -107,6 +106,8 @@ def add_cors_headers_response_callback(event):
headers
[
'Access-Control-Allow-Origin'
]
=
origin
headers
[
'Access-Control-Allow-Origin'
]
=
origin
else
:
else
:
headers
[
'Access-Control-Allow-Origin'
]
=
"*"
headers
[
'Access-Control-Allow-Origin'
]
=
"*"
if
'Access-Control-Allow-Credentials'
not
in
headers
:
headers
[
'Access-Control-Allow-Credentials'
]
=
'true'
log
.
info
(
f
"Headers: {headers}"
)
log
.
info
(
f
"Headers: {headers}"
)
response
.
headers
.
update
(
headers
)
response
.
headers
.
update
(
headers
)
...
...
opensipkd/base/views/menus.py
View file @
420a6ad
...
@@ -47,9 +47,11 @@ class AddSchema(colander.Schema):
...
@@ -47,9 +47,11 @@ class AddSchema(colander.Schema):
validator
=
colander
.
Length
(
max
=
32
),
oid
=
"kode"
)
validator
=
colander
.
Length
(
max
=
32
),
oid
=
"kode"
)
nama
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"nama"
)
nama
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"nama"
)
valu
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"valu"
,
valu
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"valu"
,
title
=
"Action"
)
title
=
"Action"
,
missing
=
colander
.
drop
)
meth
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"meth"
,
meth
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"meth"
,
title
=
"Method"
)
title
=
"Method"
,
missing
=
colander
.
drop
)
page_typ
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"page_typ"
,
page_typ
=
colander
.
SchemaNode
(
colander
.
String
(),
oid
=
"page_typ"
,
title
=
"Page Type"
)
title
=
"Page Type"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment