Skip to content

Commit

Permalink
Response HTTP 418 when error
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 committed Nov 7, 2024
1 parent c79bd22 commit a33000f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}

$results = fetch_search_results($opts, false);
if (array_key_exists("error", $results)) {
http_response_code(418); // I'm a teapot
}
header("Content-Type: application/json");
echo json_encode($results);
?>

0 comments on commit a33000f

Please sign in to comment.