Bilal-S / iis2tomcat

AJP Connector between Internet Information Services (IIS) and Apache Tomcat
http://www.boncode.net/boncode-connector
49 stars 32 forks source link

1.0.41 Bad Request Error --- GET on REST Service #86

Closed PosNerd closed 4 years ago

PosNerd commented 4 years ago

I have created a simple app with a REST service. On port 8080 a GET request responses with a JSON and all is OK. If I send a GET request via port 80 I get a HTTP 400 Bad Request.

The only information about the error I found on the browser and in the tomcats access log. ::1 - - [04/Nov/2019:20:00:07 +0100] "GET /JerseyMaven/rest/service/person/1 HTTP/1.1" 400 1160

My Versions: Windows 10 Pro with the default IIS Apache Tomcat/8.5.45 Boncode Connector 1.0.41 BadRequest

Bilal-S commented 4 years ago

Can you share with me whether this worked at one point in time and it is a new message or you have not been able to get it operational?

REST service will normally require wild-card mapping in IIS for a specific path (root of rest) or all of IIS. Do you remember setting it up?

PosNerd commented 4 years ago

This is the first time I tried to get REST operational with the connector. The wild-card mapping is set for all traffic.

I found out that this error only appears if AllowEmptyHeaders is set to true.

Bilal-S commented 4 years ago

That seems odd behavior, you may be sending conflicting header data from client to Tomcat? The AllowEmptyHeaders = false actually filters headers out when they are empty and does not manipulate the headers then true.

You can play with HeaderBlacklist and find out which header is causing the headache by Blacklisting a combination of them.

PosNerd commented 4 years ago

I don't know where this behavior come from. Now it runs with AllowEmptyHeaders=false and ist works for me.

Thank you! :)