#1 2012-10-10 08:53:56

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

URIMatch issue, which way to go...

My Unit test uses GUIDstrings for sub-urls. So My SQLModel.Root looks like

LCSServer/{..........}

Unfortunately, the HTTP translates the { into %7B causing the URIMatch to fail.

Obvously, I can change my sources to use a different system for random aliases, but
1) I guess there should be some check in there validating the URI, complaining about invalid characters (Like {, ? and other reserved characters)
2) OR make the URIMatch a bit smarter so it uses the same coding for matching the URI.
3) Or make the HTTPServer translate the html UTI back to a regular URI...?

Regards - Hans

Offline

#2 2012-10-10 09:47:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: URIMatch issue, which way to go...

Why not just set the "Root" parameter for the model after URI-encoding?

Offline

#3 2012-10-10 10:10:09

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: URIMatch issue, which way to go...

Yes that's a cool way to fix it too.

But.. unfortunately my LCS server supports NamedPipe and Messaging (and later DLL mode), which would probably break my code.
It's also a nice feature to have a more or less readable alias in requests, and generally its not a bad idea to have an Alias restricted a bit like regular identifiers.
In my case, the URI part after the LCSServer/  actually is intended to be a kind of database alias. I dont mind aliases being subject to some validation checks. at all. SO I already implemented a vaslidation check allowing only valid url characters and no special characters.

http://www.blooberry.com/indexdot/html/ … coding.htm

Hans

Offline

#4 2012-10-10 11:58:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: URIMatch issue, which way to go...

I suspect the Root string property is just a RawUTF8, so for NamedPipe or Messaging, it won't make any difference... but on login.
Why not transform your GUID into a valid path without { or } ?

Offline

#5 2012-10-10 12:48:34

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Re: URIMatch issue, which way to go...

That's exactly what I did - Ive added URL validation to my alias handler which ensures this problem cannot happen anymore.

Offline

Board footer

Powered by FluxBB