Commit Graph

31 Commits

Author SHA1 Message Date
Mark Felder 60ba6fd244 MediaProxy RFC compliance 2024-02-14 13:25:52 -05:00
Mark Felder 563aebd5ce Pleroma.Web.Plugs.UploadedMedia: dialyzer error
lib/pleroma/web/plugs/uploaded_media.ex:98:call
The function call will not succeed.

Pleroma.ReverseProxy.call(
  _conn :: %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  _url :: any(),
  _proxy_opts :: [{:http, [{:follow_redirect, true} | {:pool, :upload}, ...]}, ...]
)

breaks the contract
(Plug.Conn.t(), url :: String.t(), [option()]) :: Plug.Conn.t()
2024-01-28 14:22:35 -05:00
Mark Felder 3fbe8ada93 Pleroma.ReverseProxy: dialyzer errors
lib/pleroma/reverse_proxy.ex:225:pattern_match
The pattern can never match the type.

Pattern:
:done

Type:
{:ok, :no_duration_limit, :no_duration_limit}

lib/pleroma/reverse_proxy.ex:226:pattern_match
The pattern can never match the type.

Pattern:
{:error, _error}

Type:
{:ok, :no_duration_limit, :no_duration_limit}

lib/pleroma/reverse_proxy.ex:391:pattern_match
The pattern can never match the type.

Pattern:
__duration = nil, _max

Type:
integer(), _
2024-01-27 10:28:49 -05:00
Mark Felder 38d01ff511 Fix invalid types 2024-01-20 17:37:27 -05:00
Mark Felder 9896b64f54 Elixir 1.15: Chase the Logger.warn deprecation 2023-12-20 20:16:26 +00:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
Alex Gleason 1c3fe43d23
ReverseProxy: create Client.Wrapper to call client from config
Speeds up recompilation by reducing compile-time cycles
2021-06-04 21:12:24 -05:00
Alex Gleason 1dc5794e29 Never forward the client's user-agent through the media proxy 2021-03-01 21:05:46 +01:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
lain 713612c377 Cachex: Make caching provider switchable at runtime.
Defaults to Cachex.
2020-12-18 17:44:46 +01:00
Alexander Strizhakov 0374df1d12
other files consistency 2020-10-13 16:38:19 +03:00
Alexander Strizhakov 4e6e5d8042 reverse proxy tests 2019-07-09 16:54:13 +00:00
Alexander Strizhakov c2ca1f22a2 it is changed in compile time
we can't change module attributes and endpoint settings in runtime
2019-06-14 15:45:05 +00:00
William Pitcock 52e09807d4 reverse proxy: clean up some @hackney leftovers 2019-06-02 09:09:58 +00:00
Egor Kislitsyn 99f70c7e20 Use Pleroma.Config everywhere 2019-05-30 15:33:58 +07:00
William Pitcock 9bec891eb4 kill @httpoison 2019-05-25 04:24:21 +00:00
rinpatch d02f1120f9 Content-Disposition regex improvements 2019-03-15 08:29:51 +03:00
rinpatch 958227d556 MediaProxy: parse filename from content-disposition for non-whitelisted types 2019-03-15 01:36:29 +03:00
Haelwenn (lanodan) Monnier c42d34b2ec
[Credo] fix Credo.Check.Readability.MaxLineLength 2019-03-13 04:26:56 +01:00
href 99763999c1
reverse_proxy - always override plug's cache-control 2019-01-21 15:17:24 +01:00
William Pitcock 980b5288ed update copyright years to 2019 2018-12-31 15:41:47 +00:00
William Pitcock 2791ce9a1f add license boilerplate to pleroma core 2018-12-23 20:56:42 +00:00
Maksim Pechnikov 074fa790ba fix compile warnings 2018-12-09 20:50:08 +03:00
Hakaba Hitoyo 96ba95df2e remove follow_redirect options 2018-12-06 11:38:33 +09:00
href 8e0e20631c
Reverse proxy: default max read duration at 30 secs. 2018-11-30 19:12:03 +01:00
href 02d3dc6869
Uploads fun, part. 2 2018-11-30 18:02:37 +01:00
href 97b00d366f
reverse_proxy: more headers 2018-11-30 18:00:57 +01:00
href a2640c8088
Parse correctly content-type & do not forward content-length 2018-11-30 18:00:57 +01:00
href b19597f602
reverse proxy / uploads 2018-11-30 18:00:47 +01:00