2
모든 양식을 CSRF에서 Dancer
으로 보호하고 싶습니다.Plack :: Middleware :: CSRFBlock with Dancer를 사용하는 방법?
Plack::Middleware::CSRFBlock
을 사용해 보았지만 "CSRFBlock Session이 필요합니다." Plack::Session
을 사용하는 경우에도 양식에 한 번의 시간 토큰이 포함 된 숨겨진 입력 필드가 없습니다.
이렇게하는 것이 좋습니다. 어떤 조언을 많이 주셨습니다.
내 environment/development.yml
은 다음과 같습니다
# configuration file for development environment
# the logger engine to use
# console: log messages to STDOUT (your console where you started the
# application server)
# file: log message to a file in log/
logger: "console"
# the log level for this environment
# core is the lowest, it shows Dancer's core log messages as well as yours
# (debug, info, warning and error)
log: "core"
# should Dancer consider warnings as critical errors?
warnings: 1
# should Dancer show a stacktrace when an error is caught?
show_errors: 1
# auto_reload is a development and experimental feature
# you should enable it by yourself if you want it
# Module::Refresh is needed
#
# Be aware it's unstable and may cause a memory leak.
# DO NOT EVER USE THIS FEATURE IN PRODUCTION
# OR TINY KITTENS SHALL DIE WITH LOTS OF SUFFERING
auto_reload: 0
session: Simple
#session: YAML
plack_middlewares:
-
#- Session
- CSRFBlock
- Debug
- panels
-
- Parameters
- Dancer::Version
- Dancer::Settings
- Memory
및 경로는 다음과 같습니다
get '/test' => sub {
return <<EOM
<!DOCTYPE html>
<html>
<head><title>test route</title></head>
<body>
<form action="./foobar" method="post">
<input type="text"/>
<input type="submit"/>
</form>
</body>
</html>
EOM
};
그것이 매력처럼 작동에 그것을 설정하는 관리! 고마워요. 제 시간을 많이 구 했어요! 그리고 Dancer와 PSGI 간의 세션 제어에 대한 대답을 마침내 발견했습니다. 댄서 :: 세션 :: PSGI – ernix