Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stefann42 committed Feb 14, 2016
1 parent 68253eb commit cb62184
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Alternatively you can host your app and the AlexaSkillsKit.NET library in any ot

### Override request validation policy

By default, requests with missing or invalid signatures, or with missing or too old timestamps, are rejected. You can override the request validation policy if you'd like not to reject the request in certain conditions and/or to log validation failures you can override the policy.
By default, requests with missing or invalid signatures, or with missing or too old timestamps, are rejected. You can override the request validation policy if you'd like not to reject the request in certain conditions and/or to log validation failures.

```csharp
/// <summary>
Expand All @@ -72,25 +72,25 @@ public override bool OnRequestValidation(
{
if (result.HasFlag(SpeechletRequestValidationResult.NoSignatureHeader))
{
Log.Error("Alexa request is missing signature header, rejecting.");
Debug.WriteLine("Alexa request is missing signature header, rejecting.");
return false;
}
if (result.HasFlag(SpeechletRequestValidationResult.NoCertHeader))
{
Log.Error("Alexa request is missing certificate header, rejecting.");
Debug.WriteLine("Alexa request is missing certificate header, rejecting.");
return false;
}
if (result.HasFlag(SpeechletRequestValidationResult.InvalidSignature))
{
Log.Error("Alexa request signature is invalid, rejecting.");
Debug.WriteLine("Alexa request signature is invalid, rejecting.");
return false;
}
else
{
if (result.HasFlag(SpeechletRequestValidationResult.InvalidTimestamp))
{
var diff = referenceTimeUtc - requestEnvelope.Request.Timestamp;
Log.Warn("Alexa request timestamped '{0:0.00}' seconds ago making timestamp invalid, but continue processing.",
Debug.WriteLine("Alexa request timestamped '{0:0.00}' seconds ago making timestamp invalid, but continue processing.",
diff.TotalSeconds);
}
return true;
Expand Down

0 comments on commit cb62184

Please sign in to comment.