iis2tomcat
iis2tomcat copied to clipboard
Http Verb Issue
We are having an issue with the PATCH verb. I see requests coming into IIS as PATCH but Tomcat is saying that it received a GET. Are all of the HTTP verbs supported?
Tomcat Log 192.168.20.57 - - [30/Jan/2017:14:32:34 -0600] "GET /index.cfm?endpoint=%2Finventory%2F102057727 HTTP/1.1" 200 1039
IIS Log 2017-01-30 20:32:34 192.168.20.131 PATCH /index.cfm endpoint=%2Finventory%2F102057727 80 - 192.168.20.57 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/55.0.2883.87+Safari/537.36 cfid=0;+cftoken=0; http://myurl.com/index.cfm myurl.com 200 0 0 1752 972 1307
IIS: 8.5.9600 Lucee: 5.1.1.11-SNAPSHOT BonCode: 1.0.33
Thanks AJ
All verbs are supported. The connector does not override the verb. Can you check whether you use a URL rewriter ?
Best, B
We are using URL Rewrite. I am seeing this issue on sites that are using a rewrite and sites that are not (same host.)
I have attached the configs for both sites. no-rewrite-web.config.txt rewrite-web.config.txt
If you need more information let me know.
Thanks AJ
@Bilal-S I was looking at the code, and I see lines related to POST and PUT and GET and others, but I don't see anything for PATCH. I see PROPPATCH, but that's a different verb (although the name is similar). I was looking at BonCodeAJP13\BonCodeAJP13PacketHeaders.cs and BonCodeAJP13\BonCodeAJP13Enums.cs.
Could it just be that PATCH needs to be added?
OK. I think I found your issue. PATCH is not one of the verbs supported by the AJP protocol. If we find a verb that is not supported we default to GET. Could you use PROPPATCH instead which seems similar. Here are the supported verbs by the protocol:
public const byte BONCODEAJP13_OPTIONS = 0x01; // OPTIONS 1
public const byte BONCODEAJP13_GET = 0x02; // GET 2
public const byte BONCODEAJP13_HEAD = 0x03; // HEAD 3
public const byte BONCODEAJP13_POST = 0x04; // POST 4
public const byte BONCODEAJP13_PUT = 0x05; // PUT 5
public const byte BONCODEAJP13_DELETE = 0x06; // DELETE 6
public const byte BONCODEAJP13_TRACE = 0x07; // TRACE 7
public const byte BONCODEAJP13_PROPFIND = 0x08; // PROPFIND 8
public const byte BONCODEAJP13_PROPPATCH = 0x09; // PROPPATCH 9
public const byte BONCODEAJP13_MKCOL = 0x0A; // MKCOL 10
public const byte BONCODEAJP13_COPY = 0x0B; // COPY 11
public const byte BONCODEAJP13_MOVE = 0x0C; // MOVE 12
public const byte BONCODEAJP13_LOCK = 0x0D; // LOCK 13
public const byte BONCODEAJP13_UNLOCK = 0x0E; // UNLOCK 14
public const byte BONCODEAJP13_ACL = 0x0F; // ACL 15
public const byte BONCODEAJP13_REPORT = 0x10; // REPORT 16
public const byte BONCODEAJP13_VERSION_CONTROL = 0x11; // VERSION-CONTROL 17
public const byte BONCODEAJP13_CHECKIN = 0x12; // CHECKIN 18
public const byte BONCODEAJP13_CHECKOUT = 0x13; // CHECKOUT 19
public const byte BONCODEAJP13_UNCHECKOUT = 0x14; // UNCHECKOUT 20
public const byte BONCODEAJP13_SEARCH = 0x15; // SEARCH 21
public const byte BONCODEAJP13_MKWORKSPACE = 0x16; // MKWORKSPACE 22
public const byte BONCODEAJP13_UPDATE = 0x17; // UPDATE 23
public const byte BONCODEAJP13_LABEL = 0x18; // LABEL 24
public const byte BONCODEAJP13_MERGE = 0x19; // MERGE 25
public const byte BONCODEAJP13_BASELINE_CONTROL = 0x1A; // BASELINE_CONTROL 26
public const byte BONCODEAJP13_MKACTIVITY = 0x1B; // MKACTIVITY 27
@Bilal-S what are your thoughts on this https://bz.apache.org/bugzilla/show_bug.cgi?id=56884
@ajlemke That could be done as enhancement request. I am marking it as such. Given that the main AJP documentation is still not reflecting this exception implementation as indicated in the bug report, the demand seems low or people have found a workaround. Nonetheless, we will keep it and see when we can do this.
@Bilal-S I've hit this issue of PATCH turning into a GET too today. Bugger. Sounds like not an easy fix? PATCH is a standard way to modify a record using a REST API so it's pretty important.
Sorry to bump such an old issue but I ran into this too. And, since PATCH is a very common, standard verb in REST APIs, I thought I'd try to solicit an update on a possible fix. I see PATCH is also not listed in the AJP13 documentation but it does claim that newer versions of AJP13 can/will support other verbs that aren't listed there.
Also, if anyone has managed to work around this in a way that allowed you to use PATCH and keep the BonCode AJP connector, please do share those details!
Thanks.
+1 We're still very keen to get this implemented too
Thanks for feedback. @bhartsfield the current workaround is to use another verb
We are still looking for contributors that can help implement.
Hey @Bilal-S, we still use Boncode, has been fantastic, thank you. Just wondering if it's still in active development and whether any chance of getting the PATCH keyword added?
I was waiting on changes from a contributed branch. I will make them shortly and push things out shortly (2 weeks)
@davequested I pushed a version 1.0.44 that should have this feature. Feel free to test and provide feedback.
@Bilal-S you're an absolute legend. I've tested 1.0.44 locally and can confirm PATCH works. I also tried MERGE, works too. Thanks so much!
@Bilal-S you're an absolute legend. I've tested 1.0.44 locally and can confirm PATCH works. I also tried MERGE, works too. Thanks so much!
Shoutout to @majianlord who did most of the work on this.
Thanks @majianlord, much appreciated.