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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则