Skip to content

Commit

Permalink
Configurable rack query parser key space limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
llambeau committed Jun 14, 2024
1 parent 2a9a4a1 commit 3f95c14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.1 - 2024-06-13

* Rack parser's max key space limit is now configurable through the RACK_KEY_SPACE_LIMIT env variable

## 2.3.0 - 2024-06-06

* Sinatra >= 3.2 must be used.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ TALKTOME_SMTP_STARTTLS_AUTO true or false (see ruby Mail library)
TALKTOME_SMTP_OPENSSL_VERIFY_MODE none or peer (see ruby Mail library). Defaults to peer.
TALKTOME_BEARER_SECRET secret for the webapi, to let send emails to anyone
RACK_KEY_SPACE_LIMIT configures the max key space limit for the rack query parser
```

## Hacking Talktome
Expand Down
6 changes: 6 additions & 0 deletions lib/talktome/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class App < Sinatra::Application
g.body{ "An error occured." }
end

if key_space_limit = Talktome.env('RACK_KEY_SPACE_LIMIT')
if Rack::Utils.respond_to?("key_space_limit=")
Rack::Utils.key_space_limit = key_space_limit.to_i
end
end

set :raise_errors, true
set :show_exceptions, false
set :talktome, Talktome::Client::Local.new(ROOT_FOLDER/'templates')
Expand Down

0 comments on commit 3f95c14

Please sign in to comment.