diff --git a/responses/responses.go b/responses/responses.go index cf94854b68e1b0e2484d07ee9edb06c3932210bf..41cbed323713709c4e9a5cb0b692f2637fceb5c2 100644 --- a/responses/responses.go +++ b/responses/responses.go @@ -2,9 +2,10 @@ package responses import ( "encoding/json" - "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/map_utils" "net/http" + "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/map_utils" + "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/logs" "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/utils" @@ -116,3 +117,10 @@ func OptionsResponse() events.APIGatewayProxyResponse { Headers: map_utils.MergeMaps(utils.CorsHeaders(), ContentTypeJSONHeader), } } + +func MovedPermanentlyResponse(url string) events.APIGatewayProxyResponse { + return events.APIGatewayProxyResponse{ + StatusCode: http.StatusMovedPermanently, + Headers: map_utils.MergeMaps(utils.CorsHeaders(), map[string]string{"Location": url}), + } +}