Merge pull request #2284 from poanetwork/ab-not-found-status

add 404 status for not existing pages
pull/2283/head
Victor Baranov 5 years ago committed by GitHub
commit 0759d4dbc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 1
      apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex
  3. 11
      apps/block_scout_web/test/block_scout_web/controllers/page_not_found_controller_test.exs

@ -13,6 +13,7 @@
- [#2266](https://github.com/poanetwork/blockscout/pull/2266) - allow excluding uncles from average block time calculation
### Fixes
- [#2284](https://github.com/poanetwork/blockscout/pull/2284) - add 404 status for not existing pages
- [#2244](https://github.com/poanetwork/blockscout/pull/2244) - fix internal transactions failing to be indexed because of constraint
- [#2281](https://github.com/poanetwork/blockscout/pull/2281) - typo issues, dropdown issues
- [#2278](https://github.com/poanetwork/blockscout/pull/2278) - increase threshold for scientific notation

@ -3,6 +3,7 @@ defmodule BlockScoutWeb.PageNotFoundController do
def index(conn, _params) do
conn
|> put_status(:not_found)
|> render("index.html")
end
end

@ -0,0 +1,11 @@
defmodule BlockScoutWeb.PageNotFoundControllerTest do
use BlockScoutWeb.ConnCase
describe "GET index/2" do
test "returns 404 status", %{conn: conn} do
conn = get(conn, "/wrong", %{})
assert html_response(conn, 404)
end
end
end
Loading…
Cancel
Save