Project

General

Profile

Actions

Bug #2494

closed

foreman proxy returning html instead of JSON

Added by cristian falcas over 11 years ago. Updated over 11 years ago.

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

Description

When trying to add a smart proxy in foreman, I get this error:

Unable to save
No features found on this proxy, please make sure you enable at least one feature

here is the output from curl and the production.log file:

curl k -H "Content-Type:application/json" -H "Accept:application/json" https://foremanhost:8443/features
<!DOCTYPE html PUBLIC "
//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
<html>
<head>
<title>DHCP Web interface</title>
<link href='/css/styles.css' rel='stylesheet' />
</head>
<body>
<div id='wrapper'>
<div id='header'>
<h1>DHCP Browser</h1>
<div id='nav'>
<ol>
<a href='/dhcp'> <li>Home</li> </a>
<a href='/features'> <li>Features</li> </a>
</ol>
</div>
</div>
<div id='content'>
<h2>Suported features</h2>
<ul>

&lt;li&gt;puppet&lt;/li&gt;
&lt;li&gt;puppetca&lt;/li&gt;
&lt;li&gt;tftp&lt;/li&gt;

</ul>

&lt;/div&gt;
&lt;div id=&#039;footer&#039;&gt;
&lt;p&gt; &copy; 2010 &lt;a href=&#039;mailto:&#039;&gt; Ohad Levy &lt;/a&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

/var/log/foreman/production.log:

Failed to parse response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>DHCP Web interface</title>
<link href='/css/styles.css' rel='stylesheet' />
</head>
<body>
<div id='wrapper'>
<div id='header'>
<h1>DHCP Browser</h1>
<div id='nav'>
<ol>
<a href='/dhcp'> <li>Home</li> </a>
<a href='/features'> <li>Features</li> </a>
</ol>
</div>
</div>
<div id='content'>
<h2>Suported features</h2>
<ul>

&lt;li&gt;puppet&lt;/li&gt;
&lt;li&gt;puppetca&lt;/li&gt;
&lt;li&gt;tftp&lt;/li&gt;

</ul>

&lt;/div&gt;
&lt;div id=&#039;footer&#039;&gt;
&lt;p&gt; &copy; 2010 &lt;a href=&#039;mailto:&#039;&gt; Ohad Levy &lt;/a&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
> 757: unexpected token at '&lt;!DOCTYPE html PUBLIC &quot;//W3C//DTD XHTML
1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;DHCP Web interface&lt;/title&gt;
&lt;link href=&#039;/css/styles.css&#039; rel=&#039;stylesheet&#039; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&#039;wrapper&#039;&gt;
&lt;div id=&#039;header&#039;&gt;
&lt;h1&gt;DHCP Browser&lt;/h1&gt;
&lt;div id=&#039;nav&#039;&gt;
&lt;ol&gt;
&lt;a href=&#039;/dhcp&#039;&gt; &lt;li&gt;Home&lt;/li&gt; &lt;/a&gt;
&lt;a href=&#039;/features&#039;&gt; &lt;li&gt;Features&lt;/li&gt; &lt;/a&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#039;content&#039;&gt;
&lt;h2&gt;Suported features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;puppet&lt;/li&gt;
&lt;li&gt;puppetca&lt;/li&gt;
&lt;li&gt;tftp&lt;/li&gt;

</ul>

&lt;/div&gt;
&lt;div id=&#039;footer&#039;&gt;
&lt;p&gt; &copy; 2010 &lt;a href=&#039;mailto:&#039;&gt; Ohad Levy &lt;/a&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
'
Failed to save: No features found on this proxy, please make sure you enable at least one feature
Actions

Also available in: Atom PDF