URL issues, after a link is clicked on via email -- What's the deal? ## - url

My app is sending users email with the following:
https://blah.chacha.com/feedback/##comment-reply-169
But for some reason, sometimes when the URL is loaded in some of the user's browsers the ## are being converted to something like:
https://blah.chacha.com/feedback/#%23comment-reply-169
Any ideas what's going on here and why?

The # character isn’t valid in a fragment identifier, so it’s being escaped automatically. You should either avoid using that character inside a fragment, or explicitly unescape the value before using it.

Related

Go Integrator with Nextiva sending invalid URL

Has anyone ever used Go Integrator that Nextiva provides to send encoded urls? I have it sending a formatted variable to show the callers phone number, but any percent symbols get changed to an invalid code. Example:
websiteaddress.com/search?query=fieldvalue%3A%%Call\Contact\DisplayTel%
fieldvalue requires the colon (%3A) after to properly search the variable passed, and I added a % after %3A as without the extra % it would send the link but remove all the % symbols for the variable (Call\Contact\DisplayTel rather than the variable 916-555-1234).
For some reason when I send the URL it encodes the %3A as %03 instead, giving me a weird ASCII placeholder, showing this URL instead:
websiteaddress.com/search?query=fieldvalue%03916-555-1234
Any help would be appreciated
Figured it out. Go Integrator wants the actual characters and NOT pre-encoded URL's. Thus, the link should show:
websiteaddress.com/search?query=fieldvalue:%Call\Contact\DisplayTel%

Why is $ in url causing a 'potentially dangerous Request' error

I have a dollar symbol in a URL, which works when I click on the link, like this:
www.mysite.com/articles/a-url-with-a-$-symbol
However, Raygun is showing some users are receiving an error for this page, with the $ replaced by a &:
Message: A potentially dangerous Request.Path value was detected from the client (&).
URL: www.mysite.com/articles/a-url-with-a-&
The reported browsers that are experiencing this include Chrome, Firefox, IE and Safari.
I know that $ is a reserved chracter, but it is allowed in URLs. What would cause the browser to change it to an & and strip the remaining characters?
Check that your link to that page isn't being HtmlEncoded anywhere. If it is, the $ will get mistakenly encoded as &dollar, which is the Html encoded version.
Recommendations:
Check what the referrer page is
View the source of the referring page, checking the HTML
You'll likely find it's getting encoded in error
Note, it's also easy to HtmlEncode when you mean to UrlEncode, which alters the output slightly based on target use: Difference between Url Encode and HTML encode
I hope that helps.

htaccess credentials in URL when password contains a hash #

Using Selenium I am accessing protected pages. I need to put the credentials into the URL to prevent the .htaccess popup from appearing. This is the method suggested in Selenium documentation.
One of the locations I need to access has a hash character in the password, and this causes the browser (both Chrome and Firefox) to not understand the URL and treat it as a search term.
e.g. http://user:pass#example.com/ gets through, but http://user:pa#ss#example.com/ is not recognised as a URL.
How can I "encode" the hash?
You should use Percent-encoding to encode the hash with %23.
See also:
How to escape hash character in URL

Encrypted text to passed as id in the url in asp.net mvc

I am implementing email verification by sending email to user on registration. On successful registration a mail with link to "http://mydomain.com/Account/Activate/EncryptedKeyID." Sometime i got '/' or special character that cant be passed to the url. So, I use HttpUtility.UrlEncode to encode. But this does not help. When I click on the email it gives IIS error because of extra slash in "http://mydomain.com/Account/Activate/JLU/YmtRdRAFmBdqhR7tnA==". I have used Rijndael/AES for encrypt and decrypt.
My Questions are:
Should i go for another encryption method?
Is there any alternative?
thanks in advance for your time and help
After digging around, I find that HttpUtility.UrlEncode wont work for my case and i have to use HttpServerUtility.UrlTokenEncode as it is safer for url. It does not contain any potentially dangerous character '+' and '/' chars with '-' and '_' instead. For my case i use var ativationLink=HttpServerUtility.UrlTokenEncode(Convert.FromBase64String(Rij.Encrypt(param))); for link to add in email.
And to retrieve original param i used
var param= Rij.Decrypt(Convert.ToBase64String(HttpServerUtility.UrlTokenDecode(ActivationKey)));

How does one escape the # sign in a Url pattern in UrlMappings.groovy?

In order to maintain the current set of Urls in a project, I have to be able to use the # (pound sign) in the Url. For some reason the pound sign does not appear to work normally in this project for UrlMappings.groovy.
Is there a special escape-sequence that must be used when placing # signs in UrlMappings.groovy?
Am I missing some reason why one cannot use pound signs at all?
In the following URL Mapping example, the browser goes to the correct page, but the pageName variable is null:
"/test/${urlName}#/overview"(controller:'test', action:'overview') {
pageName = "overview"
}
I thought everything after # in the url would be treated on the client side of the browsers where it tries to find a and scroll to that location.
If you dump the request containing the pound char, do you even see the data behind #?
I used a Named URL mapping and it works fine, no need to escape the "#" sign:
name test: "/#abc" (controller: 'test', action:'homepage')
EDIT: My above answer is wrong. In fact, it falls to a special case when homepage is the default action of the view.
Netbrain is right, the path after "#" will never be sent to server. In stead, I found that it's possible using "%23" instead of "#". Please take a look at here.
For example, instead of /test#/abc we should use /test%23/abc as URL mapping (both at client side & server side).

Resources