CloudFront behaviour Path pattern matching

0

In my CloudFront I have a behaviour with Path pattern /no/app* but I have a weird situation.

When the URL is /no/.%2fapp then it is matched by the above pattern.

Tbh I have no idea why this URL is used by customers, but it is equivalent to /no/./app which is automatically normalized by a browser to /no/app but when it is not encoded then the browser is passing it as it is.

Do you have any idea why it happens?

profile picture
MG
已提問 2 年前檢視次數 538 次
1 個回答
1
已接受的答案

I got an answer from AWS Support:

Section 1.2.1 - Transcription

The design of URL encoding is to make sure all characters used in URI are in the range of US-ASCII.

Section 2.4 - When to Encode or Decode

When a URI is dereferenced, it need to be decoded.

Section 5.2.4 - Remove Dot Segments

If the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer.

Even if the URI is normalized for matching, Lambda@Edge gets the original request URI.

profile picture
MG
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南