cancel
Showing results for 
Search instead for 
Did you mean: 
brinkn
Level 9

MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

Good moring

     Since upgrading to the 7.3.2.8.0 MWG I am experiencing some issues with ICAP scanning when the submitted file contains a space in the name.  Prior to the upgrade I was able to up submit files with a space in the name.  Since the upgrade when I attempt to submit a file with a space in the name I am not getting the expected results. 

For example here is a packet capture conversation where I submitted a file called "test 1.txt".  There is no log created in the access log, and even with tracing turned on I dont get a tracing file created.

<code>

RESPMOD icap://192.168.1.1:1344/RESPMOD ICAP/1.0

Allow: 204

Connection: close

Host: 192.168.1.1

X-Client-IP: 192.168.1.2

Encapsulated: req-hdr=0, res-hdr=78, res-body=145

   GET http://192.168.1.2/1397737633/test 1.txt HTTP/1.1

Host: 192.168.1.2

HTTP/1.1 200 OK

Transfer-Encoding: chunked

Content-Length: 16

10

asdjkfhsdjfhsd.

0

</code>

Here is a packet capture conversation where I submitted a file called "test1.txt".  The difference is that I do get back the ICAP and X-WWBlockResult I expect and there is a log created in the access log.

<code>

RESPMOD icap://192.168.1.1:1344/RESPMOD ICAP/1.0

Allow: 204

Connection: close

Host: 192.168.1.1

X-Client-IP: 192.168.1.2

Encapsulated: req-hdr=0, res-hdr=76, res-body=143

   GET http://192.168.1.2/1397737550/test.txt HTTP/1.1

Host: 192.168.1.2

   HTTP/1.1 200 OK

Transfer-Encoding: chunked

Content-Length: 12

c

ksdfjsdlkf

0

ICAP/1.0 204 No modification needed

ISTag: "00002916-11.144.8-00007410"

X-WWBlockResult: 0

</code>

I searched the changed logs and can not find any mention of that change that would affect this behavior.  Is it possible that someone else can test their installation and see if they have similar behavior?  Does anyone know of a fix?

Message was edited by: brinkn on 4/17/14 7:52:47 AM CDT
0 Kudos
1 Solution

Accepted Solutions
eelsasser
Level 15

Re: MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

The current ICAP client i use has the line:

string httpRequest = "GET http://" + xClientIP + "/" + DateTime.Now.Ticks.ToString() + "/" + Uri.EscapeUriString(Path.GetFileName(fileOnDisk)) + " HTTP/1.1\r\nHost: " + xClientIP + "\r\n\r\n";

I probably changed it when I discovered a change in the MWG code.

I retested as far back as 7.3.2.0 and it still doesn't like the spaces, so you must have been using an older version before that.

0 Kudos
4 Replies
eelsasser
Level 15

Re: MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

Hi Nick,

I have not noticed that behaviour before, i'll have to test. Most of the time the ICAP client does a URL encoding to change spaces to %20.

You must have some code that does not do that. (probably from me

We might be able to insert a rule that converts the URL to String.ReplaceAll(URL," ","%20") to see if the rules can intercept it before processing.

0 Kudos
eelsasser
Level 15

Re: MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

Ok. I just tested now. You cannot alter the URL as I described above.

The only way i can get this to work is in the original ICAP client by doing a URL encode of the filename before the request is made.

0 Kudos
brinkn
Level 9

Re: MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

Thanks Erik!

     I would never talk crap about your ICAP code, it is the only example client that runs on windows.  (However, It did crash on me when I tried to send a file with a space.  )    Do you have an older 7.3 MWG that you can test against?  I absolutly agree with you that they should be URI encoded prior to being sent to the gateway, it just bothers me that it stopped working and I dont know why.  (Other then I upgraded to the latest release)  Here are a few logs from prior to the upgrade that show successfuly uploades when the file contained a space that at the time worked.

[11/Apr/2014:10:55:50 -0400] "" 255.255.255.255 200 "GET http://192.168.1.1/20140411105550/063-602 2013 Sample Summary.pdf HTTP/1.1" "" "Unverified" "" 0 "" "" "0"

[11/Apr/2014:10:58:59 -0400] "" 255.255.255.255 200 "GET http://192.168.1.1/20140411105859/335-140410 HBC.txt HTTP/1.1" "" "Unverified" "" 0 "" "" "0"

[11/Apr/2014:11:07:02 -0400] "" 255.255.255.255 200 "GET http://192.168.1.1/20140411110701/Redacted_ABC_Prescreen DEF_4.14.doc HTTP/1.1" "" "Unverified" "" 0 "" "" "0"

[11/Apr/2014:11:22:16 -0400] "" 255.255.255.255 200 "GET http://192.168.1.1/20140411112216/030-80459 2013 Test File.pdf HTTP/1.1" "" "Unverified" "" 0 "" "" "0"

0 Kudos
eelsasser
Level 15

Re: MWG7 - ICAP Scanning - Issue with File Names since Upgrading to 7.3.2.8.0

Jump to solution

The current ICAP client i use has the line:

string httpRequest = "GET http://" + xClientIP + "/" + DateTime.Now.Ticks.ToString() + "/" + Uri.EscapeUriString(Path.GetFileName(fileOnDisk)) + " HTTP/1.1\r\nHost: " + xClientIP + "\r\n\r\n";

I probably changed it when I discovered a change in the MWG code.

I retested as far back as 7.3.2.0 and it still doesn't like the spaces, so you must have been using an older version before that.

0 Kudos