Description
It looks like cloudFront redirect rule is wrong as it redirects to: https://powertools.aws.devhttps://github.com/aws-powertools/
Check out the bottom part of this log (301):
Expected Behaviour
Clicking links from the Readme sends you to an incorrect location, i.e:
https://powertools.aws.dev/lambda/typescript/latest/utilities/parameters/ instead of https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/parameters/ (note the docs
subdomain)
Although the link is correct.
If you manually fill the missing docs
part after the redirect and referred from aws, this will not redirect you and the link will become accessible.
Current Behaviour
Screen.Recording.2023-10-01.at.11.28.20.mov
Code snippet
❯ curl -v docs.powertools.aws.dev -L
* Trying 65.9.112.51:80...
* Connected to docs.powertools.aws.dev (65.9.112.51) port 80 (#0)
> GET / HTTP/1.1
> Host: docs.powertools.aws.dev
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: CloudFront
< Date: Sun, 01 Oct 2023 08:17:58 GMT
< Content-Type: text/html
< Content-Length: 167
< Connection: keep-alive
< Location: https://docs.powertools.aws.dev/
< X-Cache: Redirect from cloudfront
< Via: 1.1 3440b79c112e9514e3e6f25a7439db3c.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: TLV50-C2
< X-Amz-Cf-Id: ek7r6DLQyt445JHlD28d0PYS4pyojH9GMuPSMO19xx8EG2X5mFNfWg==
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< Referrer-Policy: strict-origin-when-cross-origin
< X-Content-Type-Options: nosniff
<
* Ignoring the response-body
* Connection #0 to host docs.powertools.aws.dev left intact
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://docs.powertools.aws.dev/'
* Trying 65.9.112.51:443...
* Connected to docs.powertools.aws.dev (65.9.112.51) port 443 (#1)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES128-GCM-SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: CN=docs.powertools.aws.dev
* start date: May 11 00:00:00 2023 GMT
* expire date: Jun 8 23:59:59 2024 GMT
* subjectAltName: host "docs.powertools.aws.dev" matched cert's "docs.powertools.aws.dev"
* issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M01
* SSL certificate verify ok.
* using HTTP/2
* h2 [:method: GET]
* h2 [:scheme: https]
* h2 [:authority: docs.powertools.aws.dev]
* h2 [:path: /]
* h2 [user-agent: curl/8.1.2]
* h2 [accept: */*]
* Using Stream ID: 1 (easy handle 0x14b010600)
> GET / HTTP/2
> Host: docs.powertools.aws.dev
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/2 301
< server: CloudFront
< date: Sun, 01 Oct 2023 08:17:58 GMT
< content-length: 0
< location: https://powertools.aws.devhttps://github.com/aws-powertools/
< x-cache: FunctionGeneratedResponse from cloudfront
< via: 1.1 e93c671d969240be8a6839ba09d3b732.cloudfront.net (CloudFront)
< x-amz-cf-pop: TLV50-C2
< x-amz-cf-id: -_XaS1QPKW3H4dhdULEI8-m5lALe8jbSRd91KsJVb3hh6ejrOj3PMA==
< x-xss-protection: 1; mode=block
< x-frame-options: SAMEORIGIN
< referrer-policy: strict-origin-when-cross-origin
< x-content-type-options: nosniff
< strict-transport-security: max-age=31536000
<
* Connection #1 to host docs.powertools.aws.dev left intact
* Issue another request to this URL: 'https://powertools.aws.devhttps//github.com/aws-powertools/'
* Could not resolve host: powertools.aws.devhttps
* Closing connection 2
curl: (6) Could not resolve host: powertools.aws.devhttps
Steps to Reproduce
Click on any documentation related link inside the readme, i.e https://powertools.aws.dev/lambda/python/latest/tutorial/
It works when adding the proper subdomain: https://docs.powertools.aws.dev/lambda/python/latest/tutorial/
Possible Solution
Update codebuilds redirect rules
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
18.x
Packaging format used
npm
Execution logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status