cancel
Showing results for 
Search instead for 
Did you mean: 
maxgb
Level 7

Trying to encode a URL with blank spaces (Set URL)

Hi,

We have an application (cannot be modified) in our environment that doesn't work with MWG 7.2 but works in MWG 6.8.7 perfectly.

The Java code try to access a web site but using a malformed URL containing blank spaces in it as we can see below.

[09/Oct/2012:17:31:47 -0300] "" 10.10.10.133 400 "GET http://maps.google.com/maps/geo?q=dfg max ert123&output=xml&sensor=false HTTP/1.1" "Public Information" "Minimal Risk" "text/html" 1191 "Java/1.5.0" "" "0"

Any suggestions?

Regards,

maxgb

0 Kudos
5 Replies
asabban
Level 17

Re: Trying to encode a URL with blank spaces (Set URL)

Hello,

I have tried to create a workaround to rewrite the blanks, but I was unable to do so. MWG cuts the URL when it sees the blank character which prevents any rule from replacing the blanks with something useful. I also tried to read the original URL from the GET request the browser sends and replace the blank by % 20, but when I do this MWG automatically encodes the % character, which causes the request to still fail.

I do not see a workaround at this time.

Since the application seems to not encode the URL while it has to the best solution would be to have the application fixed.

Maybe someone has a different approach.

Sorry,

Andre

0 Kudos
maxgb
Level 7

Re: Trying to encode a URL with blank spaces (Set URL)

Hi,

This was exactly what I did and got the same results.

Additionally, I got  the request first line and use substring to cut the URL from it. After encode the substring, giving me the desired result, I can't replace the first line with the correct one. Is that possible?

Thanks,

Max

0 Kudos
asabban
Level 17

Re: Trying to encode a URL with blank spaces (Set URL)

Hi Max,

the Request.Header.Firstline is what the client sent. I don´t think it will help when you replace it, but instead replace the URL property, because this is what MWG uses to talk to when the Request Cycle ends. Unfortunately I have done this and MWG modifies my modified URL again in an unforseen manner, causing the request to still fail.

Can you provide the traces to Jan? He can probably help with some magic :-)

Best,

Andre

0 Kudos
jschnell
Level 9

Re: Trying to encode a URL with blank spaces (Set URL)

Hello,

can you attach connection traces from this request (client and if it exists also server based)?

Thanks

Jan

0 Kudos
maxgb
Level 7

Re: Trying to encode a URL with blank spaces (Set URL)

Hi Jan,

Attached.

Don't consider in the server file the second GET as a header parameter. I was just trying to rewrite the first line of the header.

Max

Message was edited by: maxgb on 10/11/12 10:38:08 AM CDT
0 Kudos