Merge pull request #2350 from poanetwork/ab-fix-invalid-string-in-ua

fix invalid User agent headers
pull/2352/head
Victor Baranov 5 years ago committed by GitHub
commit 68fd068e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .dialyzer-ignore
  2. 1
      CHANGELOG.md
  3. 3
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex

@ -4,6 +4,6 @@
apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex:400: Function timestamp_to_datetime/1 has no local return
apps/explorer/lib/explorer/repo/prometheus_logger.ex:8: Function microseconds_time/1 has no local return
apps/explorer/lib/explorer/repo/prometheus_logger.ex:8: The call 'Elixir.System':convert_time_unit(__@1::any(),'native','microseconds') breaks the contract (integer(),time_unit() | 'native',time_unit() | 'native') -> integer()
apps/block_scout_web/lib/block_scout_web/views/layout_view.ex:174: The call 'Elixir.Poison.Parser':'parse!'(any(),#{'keys':='atoms!'}) will never return since the success typing is (binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),[{atom(),_}]) -> 'false' | 'nil' | 'true' | binary() | ['false' | 'nil' | 'true' | binary() | [any()] | number() | map()] | number() | map() and the contract is (iodata(),'Elixir.Keyword':t()) -> t()
apps/block_scout_web/lib/block_scout_web/views/layout_view.ex:175: The call 'Elixir.Poison.Parser':'parse!'(any(),#{'keys':='atoms!'}) will never return since the success typing is (binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []),[{atom(),_}]) -> 'false' | 'nil' | 'true' | binary() | ['false' | 'nil' | 'true' | binary() | [any()] | number() | map()] | number() | map() and the contract is (iodata(),'Elixir.Keyword':t()) -> t()
apps/explorer/lib/explorer/smart_contract/publisher_worker.ex:6: The pattern 'false' can never match the type 'true'
apps/explorer/lib/explorer/smart_contract/publisher_worker.ex:6: The test 5 == 'infinity' can never evaluate to 'true'

@ -4,6 +4,7 @@
- [#2294](https://github.com/poanetwork/blockscout/pull/2294) - add healthy block period checking endpoint
### Fixes
- [#2350](https://github.com/poanetwork/blockscout/pull/2350) - fix invalid User agent headers
- [#2345](https://github.com/poanetwork/blockscout/pull/2345) - do not override existing market records
- [#2337](https://github.com/poanetwork/blockscout/pull/2337) - set url params for prod explicitly
- [#2341](https://github.com/poanetwork/blockscout/pull/2341) - fix transaction input json encoding

@ -110,7 +110,8 @@ defmodule BlockScoutWeb.LayoutView do
user_agent =
case Conn.get_req_header(conn, "user-agent") do
[] -> "unknown"
user_agent -> user_agent
[user_agent] -> if String.valid?(user_agent), do: user_agent, else: "unknown"
_other -> "unknown"
end
"""

Loading…
Cancel
Save