开发者

Is it ok to have an @ sign in the query portion of a url?

开发者 https://www.devze.com 2023-04-05 16:07 出处:网络
A server I\'m working on has email addresses as part of a query 开发者_如何学Pythonin a URL that users can click on. Right now, the @ sign is encoded as an @ sign in the urls, and this works totally f

A server I'm working on has email addresses as part of a query 开发者_如何学Pythonin a URL that users can click on. Right now, the @ sign is encoded as an @ sign in the urls, and this works totally fine. I thought it would break things and that I would need to change this to a %40, but that doesn't seem to be the case (from my experience). Since I don't have access to countless different configurations and browsers, I figured I would check here to see whether or not this will be a problem elsewhere.

Anybody more knowledgeable than me wanna chime in?

Sami


Could you get by without encoding it? Probably. I believe the @ (at sign) is only used when building out an FTP URL (e.g. ftp://user:password@host:port). I would still encode it because the @ sign is a reserved character according to RFC 3986.

0

精彩评论

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

关注公众号