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
asked 2 years ago511 views
1 Answer
1
Accepted Answer

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
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions