discourse/lib/freedom_patches
Loïc Guitaut a9c988a606
DEV: Serialize cookies using MessagePack (#35082)
This PR uses MessagePack instead of JSON for serializing our cookies.

MessagePack is almost as fast as Marshal but without the security
issues. It’s also able to serialize more objects than JSON (like Time,
Symbol, etc.). As it’s a binary format, it takes less space than JSON,
sometimes half less. Finally, MessagePack isn’t Ruby-specific and
implementations exist in every existing language.

Regarding the cookies Discourse is using, we can see a small improvement
on the `_forum_session` one when it’s almost empty (around 2%), but the
more things are put into it, the more we’ll see savings. For the `_t`
cookie, we’re saving around 20% for free.
2025-10-03 11:40:49 +02:00
..
active_record_attribute_methods.rb DEV: Clean up freedom patches 2022-04-06 10:07:14 +02:00
active_record_disable_serialization.rb DEV: Remove unnecessary freedom patches 2024-08-19 12:06:54 +02:00
ams_include_without_root.rb
copy_file.rb DEV: Work around a Docker issue (#13368) 2021-06-14 17:38:36 +02:00
cose_rsapkcs1.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
fast_image.rb SECURITY: Add FastImage SSRF safe freedom patch 2024-07-03 20:49:15 +08:00
inflector_backport.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
ip_addr.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
message_pack_extensions.rb DEV: Serialize cookies using MessagePack (#35082) 2025-10-03 11:40:49 +02:00
net_http.rb FIX: Set sane default for Net::HTTP when processing a request (#28141) 2024-08-06 07:12:42 +08:00
net_http_header.rb DEV: Add a user agent to all HTTP requests that Discourse makes. (#31555) 2025-03-03 16:32:25 +11:00
propshaft_patches.rb DEV: ensure retries do not re-set attempts=0 (#33365) 2025-06-27 06:51:10 -03:00
rails_multisite.rb PERF: Don't do initialization for every DB if RAILS_DB is set (#28668) 2024-09-03 15:56:46 +10:00
request_server_session.rb DEV: Rename SecureSession to ServerSession 2025-09-18 16:31:03 +02:00
rspec_mocks_from_described_class.rb DEV: Monkey patch a from_described_class helper in RSpec::Mocks (#34021) 2025-08-05 12:03:42 +10:00
safe_buffer.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
safe_migrations.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
schema_migration_details.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
sidekiq.rb DEV: Upgrade Sidekiq to v7.3.9 2025-03-10 15:02:48 +01:00
translate_accelerator.rb DEV: Remove unnecessary freedom patches 2024-08-19 12:06:54 +02:00
web_push_request.rb SECURITY: Monkey-patch web-push gem to use safer HTTP client 2023-03-16 15:27:09 -06:00