Skip to content

Commit

Permalink
Typos and minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-thomas-carlier authored and normj committed Dec 11, 2023
1 parent 2eb29ad commit f1c00fd
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.IO;
using System.Linq;
using System.Net;
using Amazon.Lambda.Core;
#if NET6_0_OR_GREATER
using System.Buffers;
using System.Text.Json;
Expand All @@ -21,7 +20,7 @@
namespace Amazon.Lambda.Annotations.APIGateway
{
/// <summary>
/// The options used by the IHttpResult to serialize into the required format for the event source of the Lambda funtion.
/// The options used by the IHttpResult to serialize into the required format for the event source of the Lambda function.
/// </summary>
public class HttpResultSerializationOptions
{
Expand Down Expand Up @@ -55,7 +54,7 @@ public enum ProtocolVersion {

/// <summary>
/// The API Gateway protocol used as the event source.
/// RestApi -> RestApiAttrbute
/// RestApi -> RestApiAttribute
/// HttpApi -> HttpApiAttribute
/// </summary>
public ProtocolFormat Format { get; set; }
Expand Down Expand Up @@ -272,11 +271,11 @@ public static IHttpResult Ok(object body = null)
/// Creates an IHttpResult for redirect responses.
/// </summary>
/// <remarks>
/// This method uses the same logic for determing the the Http status code as the Microsoft.AspNetCore.Http.TypedResults.Redirect uses.
/// This method uses the same logic for determining the the Http status code as the Microsoft.AspNetCore.Http.TypedResults.Redirect uses.
/// https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.typedresults.redirect
/// </remarks>
/// <param name="uri">The URI to redirect to. The value will be set in the location header.</param>
/// <param name="permanent">Whether the redirect should be a permanet (301) or temporary (302) redirect.</param>
/// <param name="permanent">Whether the redirect should be a permanent (301) or temporary (302) redirect.</param>
/// <param name="preserveMethod">Whether the request method should be preserved. If set to true use 308 for permanent or 307 for temporary redirects.</param>
/// <returns></returns>
public static IHttpResult Redirect(string uri, bool permanent = false, bool preserveMethod = false)
Expand Down Expand Up @@ -317,7 +316,8 @@ public static IHttpResult Redirect(string uri, bool permanent = false, bool pres
public static IHttpResult ServiceUnavailable(int? delaySeconds = null)
{
var result = new HttpResults(HttpStatusCode.ServiceUnavailable);
if (delaySeconds != null && delaySeconds > 0)

if (delaySeconds > 0)
{
result.AddHeader("Retry-After", delaySeconds.ToString());
}
Expand Down Expand Up @@ -488,7 +488,7 @@ private static IDictionary<string, string> ConvertToV2MultiValueHeaders(IDiction

// See comment at the top about .NET Standard 2.0
#if !NETSTANDARD2_0
// Class representing the V1 API Gateway response. Very similiar to Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse but this library can
// Class representing the V1 API Gateway response. Similar to Amazon.Lambda.APIGatewayEvents.APIGatewayProxyResponse but this library can
// not take a dependency on Amazon.Lambda.APIGatewayEvents so it has to have its own version.
internal class APIGatewayV1Response
{
Expand All @@ -505,7 +505,7 @@ internal class APIGatewayV1Response
public bool IsBase64Encoded { get; set; }
}

// Class representing the V2 API Gateway response. Very similiar to Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse but this library can
// Class representing the V2 API Gateway response. Similar to Amazon.Lambda.APIGatewayEvents.APIGatewayHttpApiV2ProxyResponse but this library can
// not take a dependency on Amazon.Lambda.APIGatewayEvents so it has to have its own version.
internal class APIGatewayV2Response
{
Expand Down

0 comments on commit f1c00fd

Please sign in to comment.