Andy,

On 8/13/23 04:24, Andy Pont wrote:
I wrote...

Progress of sorts!  The request is now returning 302 instead of 404!

Looking in the log files for the backend, it has a message that says “Robot requests must be rejected” and the 302 response is due to a redirect to a permission denied page.

My understanding was the .forward() method didn’t change anything on route in either direction.
>
Using JD-GUI I have looked at the class that is generates the above error message and it appears as the result of a check on the “user-agent” setting.  I am now puzzled as what is being received by the backend servlet is the same as if it is called directly without me intercepting it.

The .forward() should keep all request headers (and many other things) in-tact. You might want to log some things in plugins/whatever to see what is being done.

You should be using the *same objects* your servlet got for the request and response when calling RequestDispatcher.forward(). You can "wrap" them if necessary to make certain modifications.

The class I looked at contains a definition of a valid non-robot user-agent string.  Is it possible to modify the request to use this before forwarding it?

Yes, but I think you should not have to. What are the possible reasons for that specific 302 response? Are you *sure* it's complaining about the User-Agent string?

If not, am I better creating a new request for the backend and copy HTTP header and body content around as needed?

That will be a giant pain in the neck. Could this possibly be done with a redirect back through the client?

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to