Project

General

Profile

Actions

Bug #3764

open

API response for unknown route returns HTML page

Added by Adam Price over 10 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

right now, if you try to access a route in the v2 API that doesn't exist, it spits back html

Actions #1

Updated by Eric Helms almost 10 years ago

  • Project changed from Katello to Foreman
  • Subject changed from API response for unknown route to API response for unknown route returns HTML page
  • Category set to API

Hitting a fake API route in production leads to an HTML response.

GET http://<hostname>/api/v2/my/fake/route

Result:

<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>
<body>

<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>

Actions

Also available in: Atom PDF