Jump to content
Maxxed

# in URLs results in HTTP 400 or 404

Recommended Posts

Delphi 2007, ICS 8.68, libssl-3. Adding "#" character to any URL results in HTTP error 400 or 404 response from server. I can reproduce it in the test applications easily - works every time 😞 For example, this URL works perfectly fine:

 

https://en.delphipraxis.net/

 

But adding "#" to the URL:

 

https://en.delphipraxis.net/#

 

results in HTTP 400 error in ICS but works perfectly in any browser. Is there any way around this problem, because I need to send both GET and POST requests with # symbol in URLs?

Share this post


Link to post

# is an anchor, an instruction to the browser on how to display the page, it is never sent to the server as part of the URL by a browser.  Your application should create a valid URL by removing the #.  ICS does not validate the URL for illegal content. 

 

Angus

  • Like 2

Share this post


Link to post

It used to work in Indy, so I thought it'll work in ICS too. Indy must have been removing the # part of the URLs silently. Thank you for your help, Angus.

  • Like 1

Share this post


Link to post
5 hours ago, Maxxed said:

Indy must have been removing the # part of the URLs silently

Yes, it does.

Share this post


Link to post

By the way, Remy, any chance to get TLS 1.3 support in Indy? This is the only reason I'm trying to migrate to ICS.

Share this post


Link to post
2 hours ago, Maxxed said:

any chance to get TLS 1.3 support in Indy? This is the only reason I'm trying to migrate to ICS.

Please avoid asking any question not directly related to ICS in this ICS dedicated forum. Indy has his own support channels.

  • Like 1

Share this post


Link to post

This is now fixed, should be in SVN tomorrow with a lot of other HTTP improvements. 

 

There is a new option to skip removing the # fragment anchor where users are deliberately using # as a parameter without escaping it.  But this is likely to be so rare the option has to be set to leave it, so technically not backward compatible which is our development philosophy.

 

Angus

  • Thanks 1

Share this post


Link to post

Wow! That's cool! Thank you very much! Looking forward to try the new version!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×