Added setting for disable csrf for development
This commit is contained in:
parent
029177587e
commit
5c1a8855bb
1 changed files with 17 additions and 1 deletions
|
|
@ -4,6 +4,22 @@ from bottle import request
|
||||||
from paramecio.citoplasma.sessions import get_session
|
from paramecio.citoplasma.sessions import get_session
|
||||||
from paramecio.citoplasma.keyutils import create_key_encrypt
|
from paramecio.citoplasma.keyutils import create_key_encrypt
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
from settings import config
|
||||||
|
|
||||||
|
no_csrf=False
|
||||||
|
|
||||||
|
if hasattr(config, 'no_csrf'):
|
||||||
|
no_csrf=config.no_csrf
|
||||||
|
|
||||||
|
except:
|
||||||
|
|
||||||
|
class config:
|
||||||
|
no_csrf=False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GetPostFiles:
|
class GetPostFiles:
|
||||||
|
|
||||||
# Need this for obtain utf8 valid values
|
# Need this for obtain utf8 valid values
|
||||||
|
|
@ -36,7 +52,7 @@ class GetPostFiles:
|
||||||
|
|
||||||
s=get_session()
|
s=get_session()
|
||||||
|
|
||||||
if ignore_csrf_token==False:
|
if ignore_csrf_token==False and no_csrf==False:
|
||||||
|
|
||||||
if 'csrf_token' in s:
|
if 'csrf_token' in s:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue