Skip to content

Commit

Permalink
Set proper Content-Type in sample responses
Browse files Browse the repository at this point in the history
  • Loading branch information
havard committed Nov 15, 2011
1 parent a19e735 commit 7ed78a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ var server = require('http').createServer(
{
if(error)
{
res.writeHead(200);
res.end('Authentication failed: ' + error);
res.writeHead(200, { 'Content-Type' : 'text/plain; charset=utf-8' });
res.end('Authentication failed: ' + error.message);
}
else if (!authUrl)
{
res.writeHead(200);
res.writeHead(200, { 'Content-Type' : 'text/plain; charset=utf-8' });
res.end('Authentication failed');
}
else
Expand All @@ -91,7 +91,7 @@ var server = require('http').createServer(
// NOTE: Passing just the URL is also possible
relyingParty.verifyAssertion(req, function(error, result)
{
res.writeHead(200);
res.writeHead(200, { 'Content-Type' : 'text/plain; charset=utf-8' });

if(error)
{
Expand All @@ -112,7 +112,7 @@ var server = require('http').createServer(
else
{
// Deliver an OpenID form on all other URLs
res.writeHead(200);
res.writeHead(200, { 'Content-Type' : 'text/html; charset=utf-8' });
res.end('<!DOCTYPE html><html><body>'
+ '<form method="get" action="/authenticate">'
+ '<p>Login using OpenID</p>'
Expand Down

0 comments on commit 7ed78a8

Please sign in to comment.