Skip to content

Passing undefined as ProxyHeader argument to cowboy_http:init/6 causes dialyzer error #1691

@eseres

Description

@eseres

Passing undefined in as the ProxyHeader argument causes a Dialyzer error because cowboy_http:init/6 specs it as ranch_proxy_header:proxy_info():

-spec init(pid(), ranch:ref(), inet:socket(), module(), ranch_proxy_header:proxy_info(), cowboy:opts()) -> ok.

However, request/5 function anticipates that ProxyHeader might actually be undefined which makes sense:

	Req = case ProxyHeader of
		undefined -> Req0;
		_ -> Req0#{proxy_header => ProxyHeader}
	end,

Could the spec for cowboy_http:init/6 be updated to accept undefined for the ProxyHeader argument?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions