0

I have this parameter user@ampliflex.co.in in my url. I want to encode it using javascript, I dont want . in my url.

Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
Romi
  • 4,833
  • 28
  • 81
  • 113

1 Answers1

1

Even if you encode . in JavaScript, the browser is allowed to unencode it before sending it to a server.

RFC 3986 section 6.2.2.2. Percent-Encoding Normalization says

The percent-encoding mechanism (Section 2.1) is a frequent source of variance among otherwise identical URIs. In addition to the case normalization issue noted above, some URI producers percent-encode octets that do not require percent-encoding, resulting in URIs that are equivalent to their non-encoded counterparts. These URIs should be normalized by decoding any percent-encoded octet that corresponds to an unreserved character, as described in Section 2.3.

'.' is an unreserved character in URLs.

unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"

Community
  • 1
  • 1
Mike Samuel
  • 118,113
  • 30
  • 216
  • 245