Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can "double-dots" be part of the path part of an URL

Tags:

http

Is it valid and safe to use the parent directory double-dots inside an URL like in the following example:

http://example.com/path/../to/file.jpg

like image 825
Karsten Avatar asked Feb 05 '23 11:02

Karsten


1 Answers

RFC3986 defines URIs.

It describes how paths are hierarchical, and how...

The path segments "." and "..", also known as dot-segments

... work in a similar way to filesystem paths.

It also describes rules for "relative resolution" in which . and .. may be removed.

Essentially, it is legal and does what you expect.

like image 161
slim Avatar answered Mar 16 '23 00:03

slim