Permalink
Browse files

Fix dialyzer warnings for webmachine_request:port_string()

Fixes two bugs:

    % git branch | egrep '\*'
    * master

    % git log | head -1
    commit 656aa69

    % dialyzer -Wno_return ebin/*beam deps/*/ebin/*beam
      Checking whether the PLT /Users/fritchie/.dialyzer_plt is up-to-date... yes
      Compiling some key modules to native code... done in 0m21.94s
      Proceeding with analysis...
    webmachine_request.erl:815: The pattern 'http' can never match the type string()
    webmachine_request.erl:820: The pattern 'https' can never match the type string()
    Unknown functions:
      compile:forms/2
      fdsrv:bind_socket/2
      fdsrv:start/0
      fdsrv:stop/0
     done in 0m15.44s
    done (warnings were emitted)
  • Loading branch information...
1 parent 656aa69 commit 01f866d0534d95079d8d440e9640e83cfd7c1a35 @slfritchie slfritchie committed Apr 5, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/webmachine_request.erl
@@ -812,12 +812,12 @@ log_data() -> call(log_data).
port_string(Scheme, Port) ->
case Scheme of
- http ->
+ "http" ->
case Port of
80 -> "";
_ -> ":" ++ erlang:integer_to_list(Port)
end;
- https ->
+ "https" ->
case Port of
443 -> "";
_ -> ":" ++ erlang:integer_to_list(Port)

0 comments on commit 01f866d

Please sign in to comment.