Home » SQL & PL/SQL » SQL & PL/SQL » Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found" (9i/10g)
Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found" [message #361181] Tue, 25 November 2008 05:21 Go to next message
elgholm
Messages: 4
Registered: November 2008
Junior Member
As the subject states..

Why?

And how can I prevent it?

It seems as the PL/SQL Agent is hardwired to produce a Status: "302 Found" when it sees the "Location" http-header. This behaviour is incorrect since there are many different statuses with the Location directive.

Example code, tested on both 9i and 10g:
PROCEDURE TEST_301
IS
BEGIN
owa_util.mime_header('text/html', false);
owa_util.status_line(301, 'Moved Permanently', false);
owa_util.redirect_url('http://www.disney.com/');

htp.p('<html><body>');
htp.p('Content permanently moved, here: http://www.disney.com/');
htp.p('</html></body>');
END;

This must be a bug.

/Charlie
Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361201 is a reply to message #361181] Tue, 25 November 2008 06:24 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
What output do you get?
When I run your code on 10g R2 (10.2.0.4) using SQL Developer, I get the following output in the OWA window:
Content-type: text/html
Status: 301 Moved Permanently
Location: http://www.disney.com/
Content-length: 84

<html><body>
Content permanently moved, here: http://www.disney.com/
</html></body>


Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361204 is a reply to message #361201] Tue, 25 November 2008 06:32 Go to previous messageGo to next message
elgholm
Messages: 4
Registered: November 2008
Junior Member
That sounds great, but try running it through the PL/SQL Agent (if you have an Oracle HTTP Server installation setup) and look what you get. That's sad.

The internal PL/SQL htp-buffer has the correct values, as you noted below. It's the mod_plsql (PL/SQL Agent) that f****s it up, and I wonder if there's any way to prevent it.
Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361205 is a reply to message #361204] Tue, 25 November 2008 06:33 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I've not got that setup here I'm afraid.

Have you raised the issue with Metalink?
Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361209 is a reply to message #361205] Tue, 25 November 2008 06:38 Go to previous messageGo to next message
elgholm
Messages: 4
Registered: November 2008
Junior Member
Yeah, I posted a question in their forum for 2 weeks ago.. Still no reply. That's why I tried here.

The reason for using 301 instead of 302 is to let searchspiders and link-tools automatically KNOW that the content has moved, so they can update their databases with the new information.

Seems sad that the PL/SQL Agent has this blunder-code in it.

[Updated on: Tue, 25 November 2008 06:38]

Report message to a moderator

Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361211 is a reply to message #361209] Tue, 25 November 2008 06:45 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
It is a bug - bug no 6512796

No workaround published.

Fixed in 11.1.1.0

It's possible they'll do a backport of the fix if you raise a SR
Re: Status: "301 Moved Permanently" internally altered by PL/SQL Agent to "302 Found& [message #361214 is a reply to message #361211] Tue, 25 November 2008 06:50 Go to previous message
elgholm
Messages: 4
Registered: November 2008
Junior Member
Thank you very much for finding me this information!

Cheers!

I don't see any luck in getting a backport, and since we're in the process of upgrading from 9i to 11g I'll have it covered then!

Thanks again!

Please let me know if I may help you in any way.
Previous Topic: Why Deadlock occured
Next Topic: Even & Odd Months
Goto Forum:
  


Current Time: Thu Dec 08 04:00:39 CST 2016

Total time taken to generate the page: 0.12903 seconds