• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

camatcode / basenji / 594b515fe95c2d0848feedc055b9a66fb92a59c3

06 Jul 2025 05:05PM UTC coverage: 64.232% (+4.7%) from 59.566%
594b515fe95c2d0848feedc055b9a66fb92a59c3

push

github

web-flow
Merge pull request #24 from camatcode/work/json_api_collections

feat(collections): json_api

43 of 49 new or added lines in 10 files covered. (87.76%)

1 existing line in 1 file now uncovered.

343 of 534 relevant lines covered (64.23%)

385.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
/lib/basenji_web/controllers/api/comics_controller.ex
1
defmodule BasenjiWeb.ComicsController do
2
  @moduledoc false
3
  use BasenjiWeb, :controller
4

5
  alias Basenji.Comics
6
  alias BasenjiWeb.API.Utils
7

8
  def get_page(conn, params) do
9
    id = params["id"]
4✔
10
    page = params["page"]
4✔
11

NEW
12
    with {:ok, page_num} <- Utils.safe_to_int(page),
×
13
         {:ok, page_stream, mime} <- Comics.get_page(id, page_num) do
4✔
14
      binary = page_stream |> Enum.to_list()
4✔
15
      {:ok, binary, mime}
4✔
16
    end
17
    |> case do
4✔
18
      {:ok, binary, mime} ->
19
        length = Enum.count(binary)
4✔
20

21
        conn
22
        |> merge_resp_headers([{"access-control-allow-origin", "*"}])
23
        |> merge_resp_headers([{"content-type", mime}])
24
        |> merge_resp_headers([{"content-length", "#{length}"}])
4✔
25
        |> merge_resp_headers([{"content-disposition", "attachment"}])
26
        |> send_resp(200, binary)
4✔
27

28
      error ->
NEW
29
        Utils.bad_request_handler(conn, error)
×
30
    end
31
  end
32
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc