Skip to content

Conversation

@crazy-max
Copy link
Member

follow-up #15151

found wrong redirects with @thaJeztah ported from s3 config to cloudfront lambda.

looks like in the s3 config some redirects just strip the key prefix and don't just redirect to /. this PR adds a new bool field strip to handle that behavior.

can be tested on labs:

$ curl -s -D - https://docs-labs.docker.com/v17.06/enterprise/ -o /dev/null
HTTP/2 301 
content-length: 0
server: CloudFront
date: Wed, 17 Aug 2022 16:18:58 GMT
location: /enterprise/
x-cache: LambdaGeneratedResponse from cloudfront
via: 1.1 89cec266da5afe1c0fd332f7f04e94e2.cloudfront.net (CloudFront)
x-amz-cf-pop: CDG3-C2
x-amz-cf-id: yjyoCPapgzOBKtOHWgmDUOTvXUhLkf1B2Vl_sWSnL36NmpnzRkf2kA==
$ curl -s -D - https://docs-labs.docker.com/ee/sqdsqdsqdsqds -o /dev/null
HTTP/2 301 
content-length: 0
server: CloudFront
date: Wed, 17 Aug 2022 16:20:14 GMT
location: /
x-cache: LambdaGeneratedResponse from cloudfront
via: 1.1 ef7ace463c0659c94b8e007b4dc9ae9a.cloudfront.net (CloudFront)
x-amz-cf-pop: CDG3-C2
x-amz-cf-id: iT3UxQIdBi1TiqP6imgPm3Jbicl4wYJdXQoTS7usqmS25RpBq-C9QA==
$ curl -s -D - https://docs-labs.docker.com/get-started/part2/ -o /dev/null
HTTP/2 301 
content-length: 0
server: CloudFront
date: Wed, 17 Aug 2022 16:19:30 GMT
location: /get-started/02_our_app/
x-cache: LambdaGeneratedResponse from cloudfront
via: 1.1 bfb83f89a06636844c21e465f3ea5ace.cloudfront.net (CloudFront)
x-amz-cf-pop: CDG3-C2
x-amz-cf-id: L8gGrTkItVxWT9mRVziKUP1OUPdU5UPUoAH2km56F_Wt8RLDbXtIGA==

also disable slack notif for labs env as it seems a bit too noisy.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max requested a review from thaJeztah August 17, 2022 16:20
@netlify
Copy link

netlify bot commented Aug 17, 2022

Deploy Preview for docsdocker ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c27e2e4
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/62fd156b8a6d2500087872ed
😎 Deploy Preview https://deploy-preview-15404--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice!

@crazy-max crazy-max merged commit c41dbdd into docker:master Aug 17, 2022
@crazy-max crazy-max deleted the fix-redirects-prefixes branch August 17, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants