Skip to content

Mint adapter does not support HTTP2 push #370

Description

@ZsoltMaslanyi

Hi guys,

This is a feature request that I can't take on on my own.

The Mint adapter does not support HTTP2 push messages and I haven't found a way to disable it through the adapter configuration.

The following arguments were given to anonymous fn/2 in Tesla.Adapter.Mint.reduce_responses/3:
# 1
{:push_promise, #Reference<0.1726172914.1690042371.196731>,
 #Reference<0.1726172914.1690042371.196749>,
 [
   {":method", "GET"},
   {":path", "/assets/index.css?1583114754"},
   {":scheme", "https"},
   {":authority", "remoteok.io"},
   {"user-agent", "mint/1.0.0"}
 ]}
# 2
%{}

Activity

  1. teamon commented on Apr 7, 2020

    @teamon
    Member

    Please share an example code, these is little I can do with the given information.

    I'm also not sure if this is a feature, or a bug. Please clarify.

  2. ZsoltMaslanyi commented on Apr 7, 2020

    @ZsoltMaslanyi
    Author

    Hi @teamon , thanks for taking the time to check this!

    Sorry if it wasn't obvious from the description, here's the example code:

    defmodule TeslaClient do
      use Tesla
      adapter(Tesla.Adapter.Mint)
    
      def get_example_http2_site() do
        get("https://remoteok.io")
      end
    end
    
    TeslaClient.get_example_http2_site()
    

    The error message is the same as the original post I wrote.
    The Mint adapter's reduce_responses/3 gets called with :push_promise to push down content on the connection, but the response is not handled by the adapter.

    Re for if it's a feature request or a bug - I'd go with feature request, but you'll be the judge.
    Tesla does have a Mint adapter, but it fails to work on any HTTP2 sites.

  3. teamon commented on Dec 17, 2021

    @teamon
    Member

    Confirmed:

    iex(5)> Tesla.get(client, "https://remoteok.com")
    ** (FunctionClauseError) no function clause matching in anonymous fn/2 in Tesla.Adapter.Mint.reduce_responses/3    
        
        The following arguments were given to anonymous fn/2 in Tesla.Adapter.Mint.reduce_responses/3:
        
            # 1
            {:push_promise, #Reference<0.179896103.3862429701.90397>,
             #Reference<0.179896103.3862429701.90400>,
             [
               {":method", "GET"},
               {":path", "/global.css?1639217940"},
               {":scheme", "https"},
               {":authority", "remoteok.com"},
               {"user-agent", "mint/1.3.0"}
             ]}
        
            # 2
            %{}
        
        (tesla 1.4.3) lib/tesla/adapter/mint.ex:328: anonymous fn/2 in Tesla.Adapter.Mint.reduce_responses/3
        (elixir 1.12.3) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
        (tesla 1.4.3) lib/tesla/adapter/mint.ex:298: Tesla.Adapter.Mint.receive_packet/4
        (tesla 1.4.3) lib/tesla/adapter/mint.ex:258: Tesla.Adapter.Mint.receive_responses/4
        (tesla 1.4.3) lib/tesla/adapter/mint.ex:197: Tesla.Adapter.Mint.format_response/3
        (tesla 1.4.3) lib/tesla/adapter/mint.ex:59: Tesla.Adapter.Mint.call/2
    
  4. moved this to Todo in Roadmapon May 8, 2022
  5. yordis commented on May 15, 2023

    @yordis
    Member
  6. yordis commented on Jun 6, 2026

    @yordis
    Member

    closed by #803

  7. moved this from Todo to Done in Roadmapon Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions