pleroma/lib/pleroma
Lain Soykaf 0615025f92
fix(http): enforce max_body again under Hackney 4
Hackney 4 ignores `with_body` and always returns a fully read binary, so
Tesla.Adapter.Hackney never reaches the clause that honours :max_body and
the option became a no-op. Only the gun path still enforced it, through
Pleroma.HTTP.Adapter.Gun. Pleroma.Web.RelMe relies on nothing else, so it
was fetching remote pages unbounded.

Add a middleware that applies the limit for every adapter: reject when
content-length already announces too much, and reject a body that came
back over the limit. Streaming bodies are left alone -- neither adapter
limits those and the caller owns the lease, so failing here on the header
would strand a connection RichMedia is still expected to release.

On the hackney path this bounds what callers are handed rather than peak
memory, since the adapter has read the body before any middleware runs.
2026-07-26 09:29:36 +04:00
..
activity Do not use Enum.map for side-effects 2026-02-27 16:24:10 +01:00
captcha Fix some more typos 2023-12-28 00:17:04 +01:00
chat Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
config Elixir 1.19: Emit debug logger reconfiguration logs in test env as well 2026-07-18 23:02:38 +02:00
conversation Add missing type 2024-07-22 15:32:20 -04:00
date_time Linting 2025-03-11 18:21:27 +04:00
docs Elixir 1.19: Fix most MRFs being absent from AdminAPI suggestions. 2026-06-16 20:22:24 +02:00
ecto_type ConfigDB, RateLimiter, RateLimit: Use new type to parse and cast rate limits. 2026-01-06 16:34:17 +04:00
emails Remove WorkerHelper 2024-07-30 11:34:48 -04:00
emoji Emoji: Handle more edge cases for local emoji with strange filenames. 2026-01-06 15:12:49 +04:00
gopher Gopher: Fix crash on (re)boot when ConfigDB is enabled 2026-02-17 00:47:57 +01:00
gun fix(gun): tolerate a missing client monitor on release 2026-07-25 18:46:44 +04:00
helpers Dialyzer: fix pattern matches preventing video thumbnailing from working 2024-05-28 10:19:22 -04:00
http Merge remote-tracking branch 'origin/develop' into audit-mix-audit-report 2026-07-25 19:54:48 +04:00
instances Rename Instance.delete_users_and_activities/1 to Instance.delete/1 2025-06-28 13:37:06 -07:00
language Merge remote-tracking branch 'origin/develop' into translation-provider-translatelocally 2025-11-28 15:07:43 +01:00
mfa lint 2026-03-25 19:35:46 +00:00
migration_helper Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
migrators Pleroma.Migrators.Support.BaseMigrator: Fix dialyzer errors 2024-01-22 18:37:13 -05:00
object Update voters count in remote polls when refreshing 2025-09-27 10:50:51 +02:00
password Fix atom leak in password digest functionality 2024-02-14 17:54:56 -05:00
reverse_proxy Merge remote-tracking branch 'origin/develop' into audit-mix-audit-report 2026-07-25 19:54:48 +04:00
search Move object_to_search_data/1 to Pleroma.Search 2026-03-25 14:47:39 -07:00
signature PublisherTest: Use mox instead of mock. 2025-09-05 14:18:12 +04:00
telemetry feat(http): rework Gun connection pooling 2026-07-17 20:35:17 +04:00
tesla/middleware fix(http): enforce max_body again under Hackney 4 2026-07-26 09:29:36 +04:00
tests Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
upload StripLocation, ReadDescription: Silence noisy errors. 2026-01-08 13:40:25 +04:00
uploaders File.mkdir_p -> Pleroma.Backports.mkdir_p 2025-06-16 12:48:47 +02:00
user Merge pull request 'Better user search' (#7793) from gitlab-mr-iid-4416 into develop 2026-05-13 09:53:52 +00:00
utils Make URI encoding query quirks host-aware 2025-12-10 14:56:06 +01:00
web Merge remote-tracking branch 'origin/develop' into audit-mix-audit-report 2026-07-25 19:54:48 +04:00
workers test(workers): replace publisher mocks with Mox 2026-07-24 17:43:02 +04:00
activity.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
announcement.ex Announcement: fix dialyzer errors and add typespec for the changeset 2024-01-22 18:37:13 -05:00
announcement_read_relationship.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
application.ex Elixir 1.19: Replace ugly old logger config checks with config merging 2026-03-25 19:35:46 +00:00
application_requirements.ex Merge remote-tracking branch 'origin/develop' into translate-posts 2025-03-19 17:59:24 +01:00
backports.ex backports: Copy mkdir_p TOCTOU fix from elixir PR 14242 2025-06-16 12:46:00 +02:00
bookmark.ex Various bookmark folders-related improvements 2026-03-02 23:41:46 +01:00
bookmark_folder.ex Various bookmark folders-related improvements 2026-03-02 23:41:46 +01:00
caching.ex Pleroma.Web.RichMedia.Parser: Remove test-specific codepaths 2024-02-06 18:33:54 -05:00
captcha.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
chat.ex Allow disabling Chats feature 2026-07-24 00:58:58 +02:00
clippy.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
config.ex Mogrify/Mogrifun: Asyncify 2025-02-25 17:08:21 +04:00
config_db.ex ConfigDB, RateLimiter, RateLimit: Use new type to parse and cast rate limits. 2026-01-06 16:34:17 +04:00
constants.ex constants: remove favicon.png from static_only_files 2026-03-05 20:21:19 +00:00
conversation.ex Credo.Check.Readability.PredicateFunctionNames 2024-01-26 16:59:58 -05:00
counter_cache.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
data_migration.ex Pleroma.Migrators.Support.BaseMigratorState: fix dialyzer error 2024-01-22 18:37:13 -05:00
date_time.ex Linting 2025-03-11 18:21:27 +04:00
delivery.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
ecto_enums.ex Refactor backups to be fully controlled by Oban 2024-07-23 10:30:40 -04:00
emoji-test.txt emoji-test: update to latest 15.0 draft 2022-08-20 00:21:07 +02:00
emoji.ex Emoji, AccountView, UtilController: Handle encoding of emoji 2026-01-07 10:40:45 +04:00
filter.ex Remove WorkerHelper 2024-07-30 11:34:48 -04:00
following_relationship.ex paginate follow requests (#460) 2026-01-07 15:32:16 +01:00
formatter.ex fix(deps): replace mdex with earmark parser 2026-07-23 13:02:28 +04:00
frontend.ex Update Pleroma-FE build artifacts URL 2026-05-06 13:55:45 +00:00
gun.ex feat(http): rework Gun connection pooling 2026-07-17 20:35:17 +04:00
hashtag.ex Credo 2025-08-01 10:41:53 -07:00
healthcheck.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
html.ex RichMedia refactor 2024-05-07 19:54:56 -04:00
http.ex fix(http): enforce max_body again under Hackney 4 2026-07-26 09:29:36 +04:00
http_signatures_api.ex HTTPSignaturePlugTest: Rewrite to use mox. 2024-05-28 14:00:25 +04:00
instances.ex Rename Instance.delete_users_and_activities/1 to Instance.delete/1 2025-06-28 13:37:06 -07:00
job_queue_monitor.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
jwt.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
keys.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
ldap.ex Reorganize the LDAP module 2024-10-11 15:51:56 -04:00
list.ex Allow attaching emojis to user lists 2026-06-23 16:08:52 +02:00
logging.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
maintenance.ex Elixir 1.15: Chase the Logger.warn deprecation 2023-12-20 20:16:26 +00:00
maps.ex Use Map.filter now that minimum Elixir version is 1.13 2024-08-21 14:50:19 -04:00
marker.ex Elixir 1.19: Only match once on structs 2026-03-25 19:35:46 +00:00
mfa.ex Pleroma.MFA: fix gradient error 2024-02-02 12:14:15 -05:00
moderation_log.ex Allow assigning users to reports 2026-01-28 10:35:19 +01:00
mogrify_behaviour.ex Linting 2025-03-11 18:21:27 +04:00
mogrify_wrapper.ex Linting 2025-03-11 18:21:27 +04:00
notification.ex Persist notification group keys 2026-05-23 11:38:33 +04:00
object.ex Fix votersCount inflation in multiple-choice polls 2026-05-06 11:33:34 +04:00
object_tombstone.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
pagination.ex provide full replies collection in ActivityPub objects 2025-10-09 15:15:16 +02:00
password_reset_token.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
prom_ex.ex Switch to PromEx for prometheus metrics 2023-11-13 15:34:59 -05:00
registration.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
release_tasks.ex pleroma_ctl: Properly handle user arguments with whitespace 2026-04-24 18:04:31 +02:00
repo.ex Switch to PromEx for prometheus metrics 2023-11-13 15:34:59 -05:00
report_note.ex Fix invalid typespec references to Ecto.Changeset.t() 2024-01-20 16:47:50 -05:00
reverse_proxy.ex Merge remote-tracking branch 'origin/develop' into audit-mix-audit-report 2026-07-25 19:54:48 +04:00
rule.ex Add hint to rules 2024-04-06 11:45:19 +02:00
safe_zip.ex Fix dialyzer error in safe_zip: Remove impossible pattern match for {:get_type, _e} 2025-07-22 15:21:20 -07:00
scheduled_activity.ex Oban queue simplification 2024-05-27 13:48:17 -04:00
search.ex Move object_to_search_data/1 to Pleroma.Search 2026-03-25 14:47:39 -07:00
signature.ex Signature: Treat HTTP signature errors as invalid 2026-05-12 08:52:42 +04:00
stats.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
thread_mute.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
upload.ex Elixir 1.19: Fix typing violation on struct updates in Pleroma.Upload 2026-03-25 19:35:46 +00:00
user.ex fix(user): correct cache key invalidation 2026-07-24 16:01:13 +04:00
user_invite_token.ex Fix invalid typespec references to Ecto.Changeset.t() 2024-01-20 16:47:50 -05:00
user_note.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
user_relationship.ex MastoAPI AccountView: Add mute/block expiry to the relationship object 2026-01-28 13:49:34 +01:00
utils.ex Elixir 1.19: Fix deprecation warning when invoking ParallelCompiler 2026-03-25 19:35:46 +00:00
web.ex Fix Phoenix upstream migration regressions 2026-05-11 22:14:01 +04:00
xml_builder.ex Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00