Http POST requests changed to GET by proxy?

S

schonlinner

Hi,

we have a software solution which works fine since several years for
several different companies: It's an applet which communicates with a
servlet using HTTP POST connections and displays results from the
server/servlet.

A new potential customer (i.e. company) now encounters a weird
behaviour: They have some kind of Microsoft proxy server sitting
between the applet and the servlet engine.

When our applet creates a HTTP connection to the server it uses
something as follows:

conn.setRequestMethod ("POST");
conn.setRequestHeader(...,...);
PrintWriter out = new PrintWriter(connect.getOutputStream());
out.println(data);
out.flush();
connect.connect();

Normally one would expect that this leads to a call to doPost of the
servlet.
But for an unknown reason the Microsoft proxy does something completely
unknown and creates an HTTP GET request, thus doGet will be called on
the server and the content of the request is missing and the request
thus is invalid.
This does not happen all the time, it happens round about every tenth
time or after about 15 secs of idle time (i.e. when the user does not
make a connection to the server).

Does anybody out there have a similar problem and perhaps a solution?
Why does the MS proxy change something in the request?

We cannot further examine which request headers get sent because the
presentation is over (had to use a modem dial connection) and all we
have are the log entries.

Hoping for some clarifying answers,
Alex
 
J

Jeffrey H. Coffield

Hi,

we have a software solution which works fine since several years for
several different companies: It's an applet which communicates with a
servlet using HTTP POST connections and displays results from the
server/servlet.

A new potential customer (i.e. company) now encounters a weird
behaviour: They have some kind of Microsoft proxy server sitting
between the applet and the servlet engine.

When our applet creates a HTTP connection to the server it uses
something as follows:

conn.setRequestMethod ("POST");
conn.setRequestHeader(...,...);
PrintWriter out = new PrintWriter(connect.getOutputStream());
out.println(data);
out.flush();
connect.connect();

Normally one would expect that this leads to a call to doPost of the
servlet.
But for an unknown reason the Microsoft proxy does something completely
unknown and creates an HTTP GET request, thus doGet will be called on
the server and the content of the request is missing and the request
thus is invalid.
This does not happen all the time, it happens round about every tenth
time or after about 15 secs of idle time (i.e. when the user does not
make a connection to the server).

Does anybody out there have a similar problem and perhaps a solution?
Why does the MS proxy change something in the request?

We cannot further examine which request headers get sent because the
presentation is over (had to use a modem dial connection) and all we
have are the log entries.

Hoping for some clarifying answers,
Alex
This may not be related but some versions of Internet Explorer on a Mac
do a get before the post if the user clicks on the back button. We now
just tell all Mac users that IE is no longer supported and they should
upgrade to a different browser.

Jeff Coffield
 
T

trippy

(e-mail address removed) took the hamburger, threw it on the grill, and I
said "Oh wow"...
Hi,

we have a software solution which works fine since several years for
several different companies: It's an applet which communicates with a
servlet using HTTP POST connections and displays results from the
server/servlet.

A new potential customer (i.e. company) now encounters a weird
behaviour: They have some kind of Microsoft proxy server sitting
between the applet and the servlet engine.

When our applet creates a HTTP connection to the server it uses
something as follows:

conn.setRequestMethod ("POST");
conn.setRequestHeader(...,...);
PrintWriter out = new PrintWriter(connect.getOutputStream());
out.println(data);
out.flush();
connect.connect();

Normally one would expect that this leads to a call to doPost of the
servlet.
But for an unknown reason the Microsoft proxy does something completely
unknown and creates an HTTP GET request, thus doGet will be called on
the server and the content of the request is missing and the request
thus is invalid.
This does not happen all the time, it happens round about every tenth
time or after about 15 secs of idle time (i.e. when the user does not
make a connection to the server).

Does anybody out there have a similar problem and perhaps a solution?
Why does the MS proxy change something in the request?

We cannot further examine which request headers get sent because the
presentation is over (had to use a modem dial connection) and all we
have are the log entries.

Hoping for some clarifying answers,
Alex

Call doPost from doGet.

public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

doPost(req, res);

}

--
trippy
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

NP: "Jellyroll" -- Blue Murder

"Now, technology's getting better all the time and that's fine,
but most of the time all you need is a stick of gum,
a pocketknife, and a smile."

-- Robert Redford "Spy Game"
 
S

schonlinner

trippy said:
(e-mail address removed)
[...]
When our applet creates a HTTP connection to the server it uses
something as follows:

conn.setRequestMethod ("POST");
conn.setRequestHeader(...,...);
PrintWriter out = new PrintWriter(connect.getOutputStream());
out.println(data);
out.flush();
connect.connect();
[...]

Call doPost from doGet.

public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

doPost(req, res);

}

Nice idea, but does not work: When we execute the HTTP POST command, we
transfer some data in the body of the HTTP request. Apparently a HTTP
GET request cannot transfer that data, thus that data does not arrive
at the servlet. Our server then has an incomplete GET request which
originally was a POST request. We don't know why the proxy in-between
"changed" something and thus destroyed the original HTTP request.

Best regards,
Alex
 
T

trippy

(e-mail address removed) took the hamburger, threw it on the grill, and I
said "Oh wow"...
(e-mail address removed)
[...]
When our applet creates a HTTP connection to the server it uses
something as follows:

conn.setRequestMethod ("POST");
conn.setRequestHeader(...,...);
PrintWriter out = new PrintWriter(connect.getOutputStream());
out.println(data);
out.flush();
connect.connect();
[...]

Call doPost from doGet.

public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

doPost(req, res);

}

Nice idea, but does not work:

Yes it does. It's what you're supposed to do when you want a servlet
that handles both post and get requests.
When we execute the HTTP POST command, we
transfer some data in the body of the HTTP request. Apparently a HTTP
GET request cannot transfer that data, thus that data does not arrive
at the servlet.

Oooh, I get it now. That's a different animal and I'm not sure about
that. Any idea what causes that? Because in theory at least, whatever
that would get transferred to the doPost will be same thing as what the
doGet call would get.
Our server then has an incomplete GET request which
originally was a POST request. We don't know why the proxy in-between
"changed" something and thus destroyed the original HTTP request.

Best regards,
Alex

--
trippy
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

NP: "Jellyroll" -- Blue Murder

"Now, technology's getting better all the time and that's fine,
but most of the time all you need is a stick of gum,
a pocketknife, and a smile."

-- Robert Redford "Spy Game"
 
S

schonlinner

trippy said:
Oooh, I get it now. That's a different animal and I'm not sure about
that. Any idea what causes that? Because in theory at least, whatever
that would get transferred to the doPost will be same thing as what the
doGet call would get.

No, I don't know what is causing that problem and why the proxy is
changing and thus destroying the request. But as nobody has an
explanation for that and keeping in mind that thousands of other people
make very similar things (i.e. create HTTP connections to a servlet
from an applet using URLConnection, etc.) and apparently don't have
such problems it seems to be some kind of other (non-discovered) bug in
my code when creating the request.

Perhaps it's an unknown HTTP header parameter (we use some custom HTTP
header parameters to transport some information). Or perhaps it's
because the HTTP body does not contain name/value pairs, instead it
contains just serialized java objects...I really don't know :-((

Best regards,
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top