开发者

What is best practice use of dot slash?

开发者 https://www.devze.com 2022-12-18 00:05 出处:网络
I am seeing a great number of errors in our log files related t开发者_如何学编程o the use of the dot-slash \"./\" on the href attribute of the anchor tag. It only happens when the hit comes from a jav

I am seeing a great number of errors in our log files related t开发者_如何学编程o the use of the dot-slash "./" on the href attribute of the anchor tag. It only happens when the hit comes from a java client.

HTML DOCUMENT

<a href="./myPage.php">Link to a dot-slash file</a>

ACCESS LOG ENTRY

my.domain.com 123.456.789.012 - - [26/Jan/2010:14:17:15 -0500] "GET /legal/./myPage.php HTTP/1.1" 200 5295 "-" "Java/1.6.0_14"

ERROR LOG ENTRY

[Tue Jan 26 14:17:15 2010] [error] [client 123.456.789.012] request failed: erroneous characters after protocol string: GET /legal/\\" + gaJsHost + \\"google-analytics.com/ga.js HTTP/1.1

Is it a best practice to use or not use the dot-slash?


As far as I know the dot-slash is only used in *nix and not "on the internet". I'd advise not using it, also because (afaik)

href="./example.php"

is pretty much the same as

href="example.php"
0

精彩评论

暂无评论...
验证码 换一张
取 消