Disable sessions for endpoints that do not require them

This commit is contained in:
Ryan Cavicchioni 2024-08-17 13:52:59 -05:00
parent ac5f98d865
commit 83a6152472
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D

1
app.rb
View File

@ -206,6 +206,7 @@ before do
# content_type 'text/plain' # content_type 'text/plain'
sleep(1) while Sleep.instance.asleep? && request.path_info != "/livez/sleep" sleep(1) while Sleep.instance.asleep? && request.path_info != "/livez/sleep"
content_type :text if request.path_info.start_with? "/_cat" content_type :text if request.path_info.start_with? "/_cat"
request.session_options[:skip] = !request.path_info.start_with?("/session")
end end
get "/" do get "/" do