Merge pull request #2416 from poanetwork/vb-router-fixes

Fix "page not found" handling in the router
pull/2421/head
Victor Baranov 5 years ago committed by GitHub
commit d1b06ecd06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/block_scout_web/lib/block_scout_web/controllers/address_logs_controller.ex
  3. 4
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
  4. 2
      apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex
  5. 2
      apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex
  6. 2
      apps/block_scout_web/lib/block_scout_web/router.ex

@ -11,6 +11,7 @@
- [#2324](https://github.com/poanetwork/blockscout/pull/2324) - set timeout for loading message on the main page
### Fixes
- [#2416](https://github.com/poanetwork/blockscout/pull/2416) - Fix "page not found" handling in the router
- [#2410](https://github.com/poanetwork/blockscout/pull/2410) - preload smart contract for logs decoding
- [#2405](https://github.com/poanetwork/blockscout/pull/2405) - added templates for table loader and tile loader
- [#2398](https://github.com/poanetwork/blockscout/pull/2398) - show only one decoded candidate

@ -115,4 +115,6 @@ defmodule BlockScoutWeb.AddressLogsController do
not_found(conn)
end
end
def search_logs(conn, _), do: not_found(conn)
end

@ -130,6 +130,8 @@ defmodule BlockScoutWeb.AddressTransactionController do
end
end
def token_transfers_csv(conn, _), do: not_found(conn)
def transactions_csv(conn, %{"address_id" => address_hash_string}) do
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),
{:ok, address} <- Chain.hash_to_address(address_hash) do
@ -149,4 +151,6 @@ defmodule BlockScoutWeb.AddressTransactionController do
not_found(conn)
end
end
def transactions_csv(conn, _), do: not_found(conn)
end

@ -52,6 +52,8 @@ defmodule BlockScoutWeb.ChainController do
end
end
def search(conn, _), do: not_found(conn)
def token_autocomplete(conn, %{"q" => term}) when is_binary(term) do
if term == "" do
json(conn, "{}")

@ -30,6 +30,8 @@ defmodule BlockScoutWeb.SmartContractController do
end
end
def index(conn, _), do: not_found(conn)
def show(conn, params) do
with true <- ajax?(conn),
{:ok, address_hash} <- Chain.string_to_address_hash(params["id"]),

@ -261,6 +261,6 @@ defmodule BlockScoutWeb.Router do
get("/api_docs", APIDocsController, :index)
get("/eth_rpc_api_docs", APIDocsController, :eth_rpc)
get("/:page", PageNotFoundController, :index)
get("/*path", PageNotFoundController, :index)
end
end

Loading…
Cancel
Save