Body replaced when setting status_line

This is about a special situation on a customer APEX system. Before we used mod_plsql, now we are on ORDS 2.0.9.
The problematic part is a procedure inside a package called via URL, e.g. http://myschema.myprocedure.myfunction?param1=abc&param2=def
This function tests the input parameters, especially if that combination is allowed. In case it is not allowed, it returns a HTTP status 401. This is done using:
BEGIN
    IF not_authorized
    THEN
        OWA_UTIL.status_line
          ( nstatus => 401
          , creason => 'This combination of input parameters is unauthorized!'
        HTP.P('This combination of input parameters is unauthorized!');
    ELSE
    END IF;
END;
Using mod_plsql this actually returned HTTP 401 and the string "This combination of input parameters is unauthorized!" in the body. Now, using ORDS we seem to get an error page, see here a curl response:
HTTP/1.1 401 Unauthorized
Date: Mon, 12 Jan 2015 17:22:13 GMT
Server: Oracle-REST-Data-Services2.0.9.224.01.05
X-DB-Content-length: 75
Content-Type: text/html;charset=UTF-8
Connection: close
Transfer-Encoding: chunked
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6"> <![endif]-->
<!--[if IE 7 ]>         <html class="ie7 no-css3"> <![endif]-->
<!--[if IE 8 ]>         <html class="ie8 no-css3"> <![endif]-->
<!--[if IE 9 ]>         <html class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html>
<!--<![endif]-->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style type="text/css" media="screen">html,body,div,span,h3,p,ol,ul,li,header,hgroup{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}header,hgroup{display:block}body{font:normal 12px/16px Arial,sans-serif;margin:0 auto;background:#6a9cda}header#xHeader{border-bottom:1px solid #8fa4c0;position:relative;z-index:10;background:none #000}header#xHeader hgroup{width:974px;margin:0 auto;position:relative;height:36px;background:none #000}header#xHeader a#uLogo{margin:8px 0;display:inline-block;font:bold 14px/20px Arial,sans-serif;color:#AAA;text-decoration:none}header#xHeader a#uLogo span.logo{color:#F00}.no-css3 div#xContentContainer div.xContent{padding-top:14px}.no-css3 div#xContentContainer div.xContent div.xMainLeft h2{margin-top:0}div#xWhiteContentContainer{margin-bottom:30px}div#xWhiteContentContainer.xContentWide{background:#FFF;margin-bottom:0}div#xWhiteContentContainer.xContentWide div.xWhiteContent{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}div#xWhiteContentContainer div.xWhiteContent{width:974px;margin:0 auto;padding:0 0 20px 0;background:#FFF;min-height:500px;-moz-border-radius:0 4px 4px 4px;-webkit-border-radius:0 4px 4px 4px;border-radius:0 4px 4px 4px;-moz-box-shadow:0 1px 2px rgba(0,0,0,0.15);-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.15);box-shadow:0 1px 2px rgba(0,0,0,0.15)}div#xContentHeaderContainer{background:#6a9cda;-moz-box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset;-webkit-box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset;box-shadow:0 -1px 0 rgba(0,0,0,0.15) inset}div#xContentHeaderContainer div.xContentHeader{width:974px;margin:0 auto;padding:30px 0 32px 0;position:relative;min-height:60px}div#xContentHeaderContainer div.xContentHeader h3{font:bold 24px/24px Arial,sans-serif;color:#fff;text-shadow:0 2px 1px rgba(0,0,0,0.25);margin:0 0 20px 0}div#xFooterContainer{min-height:200px;border-top:1px solid rgba(0,0,0,0.15);background:#6a9cda}body.errorPage div#xContentHeaderContainer div.xContentHeader{min-height:30px}body.errorPage div#xContentHeaderContainer div.xContentHeader h3{font:bold 30px/30px Arial,sans-serif;color:#FFF;text-shadow:0 1px 2px rgba(0,0,0,0.25);margin:0}div.errorPage p{font:normal 14px/20px Arial,sans-seri;color:#666;padding:0 0 10px 0}div.errorPage ul{list-style:disc outside;padding:0 10px 0;margin:0 0 20px 0}div.errorPage ul li{font:normal 12px/16px Arial,sans-serif;color:#666;margin:0 0 8px 10px}pre{font-family:Consolas,"Lucida Console","Courier New",Courier,monospace}
</style>
<script type="text/javascript" charset="utf-8">
    'header hgroup'.replace(/\w+/g,
            function(n) {
                document.createElement(n)
</script>
<title>Unauthorized</title>
</head>
<body class="errorPage">
    <header id="xHeader">
        <hgroup>
            <a id="uLogo" href="./"><span class="logo">ORACLE</span>
                REST DATA SERVICES</a>
        </hgroup>
    </header>
    <div id="xContentHeaderContainer">
        <div class="xContentHeader">
            <h3>
                <span class="statusCode">401</span> - <span
                    class="statusMessage">Unauthorized</span>
            </h3>
        </div>
    </div>
    <div id="xWhiteContentContainer" class="xContentWide">
        <div class="xWhiteContent">
            <div class="errorPage">
                <p>
                <ul class="reasons">
                </ul>
                </p>
                <p>
                <pre></pre>
                </p>
                <p>
                <pre></pre>
                </p>
            </div>
        </div>
    </div>
    <div id="xFooterContainer">
    </div>
</body>
</html>
Any ideas how to prevent that auto generated error page and have my string in the body again?
Regards,
Peter
Update: some additional Information.
Above PL/SQL code snippet works as expected when used within a Restful WS (GET PLSQL). There it shows the body outputted with htp.p.
It does NOT work correct when called as a procedure through URL.
Any ideas??
Message was edited by: peter_raganitsch

The only way the body will be rendered is if the status is NOT an error status. So for example, this issue doesn't affect APEX because all APEX error pages return a 200 OK status.
I'm loathe to recommend that solution though since it's breaking HTTP semantics, but it would work. Also if you defined your own custom error code that falls out side the error code range (400 - 599) then the body would be rendered. But again a custom error is non-uniform and will make interoperability harder.
p.s. It seems odd to me that you are using 401 as the status in your original post. It suggest that access control is being done based on the client specifying a particular parameter, what's to stop a malicious client faking a request with the necessary parameter? I would expect access control to be done based on something passed in the request headers, an access token, or a cookie and transmitted over HTTPS only. Perhaps the example isn't really about authorization but about input validation, in which case the correct response would be 400 Bad Request.

Similar Messages

  • Yosemite is awful- unable to empty trash, volume options are haywire, error codes on file management, and files won't replace when moved. What are my options at this point?

    Like the topic - "Yosemite is awful- unable to empty trash, volume options are haywire, error codes on file management, and files won't replace when moved. What are my options at this point?"
    I installed this OS, and it looks nice, but it's terrible to use. I randomly have the volume controls get disabled, and sometimes the volume menu in the system tray does nothing when adjusted which I've never seen in an OS before. The trash won't empty. When I try to drag and drop newer files over existing ones, nothing happens. The old ones just stay there. I have to delete the old ones and then move the new ones. And when I go into the protected files to manage audio plugins (I make music), the first thing I hit are error codes galore, and password prompts that either don't popup when they should, or don't execute the command after I provide my password.
    What can I do now that I installed the flames of **** onto my computer?

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    resetp
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

  • Bug in FB 4.7 when setting verbose-stacktraces to True

    Hello guys,
    When setting the verbose-stacktraces to true without setting the debug parameter to true, it has no effect. When I get a stacktrace it doesn't include any line numbers as stated on the documentation. I'm currently using Flash Builder 4.7, Adobe Flex 4.6 and Air 4 SDK to develop my mobile application. Also, I'm using the compiler options: -locale en_US -swf-version=23 -verbose-stacktraces=true.
    I need to be able to see the line numbers so I would really appreciate any help on this issue.
    Regards,
    Sebastian

    I also tried with replacing -verbose-stacktraces=true with -compiler.verbose-stacktraces=true as I've seen in some examples but nothing happens.
    Next you have an example of a stacktrace missing the line numbers:
    TypeError: Error #1009
            at components.visual::BaseECView/configureComponents()
            at views.home::Home/createChildren()
            at mx.core::UIComponent/initialize()
            at spark.components::View/initialize()
            at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
            at mx.core::UIComponent/addChildAt()
            at spark.components::Group/addDisplayObjectToDisplayList()
            at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()
            at spark.components::Group/addElementAt()
            at spark.components::Group/addElement()
            at spark.components::SkinnableContainer/addElement()
            at spark.components::ViewNavigator/createViewInstance()
            at spark.components::ViewNavigator/commitNavigatorAction()
            at spark.components::ViewNavigator/commitProperties()
            at mx.core::UIComponent/validateProperties()
            at mx.managers::LayoutManager/validateProperties()
            at mx.managers::LayoutManager/doPhasedInstantiation()
            at mx.managers::LayoutManager/doPhasedInstantiationCallback()
            at flash.utils::Timer/tick()

  • New Iphone 5, wont connect to or will drop wifi signal when set up as new phone but will stay connected and work fine when backed up as my old 3gs

    Just got a new phone but it wont connect to or will drop wifo signal when set up as a new phone.  Apple replaced it and I have the same problem.  When I back the phone up as my old 3gs I have no problems at all

    its an iphone 5, and wifi not wifo lol

  • Replacing a set of characters from a string in oracle sql query

    I want to replace a set of characters ( ~    !     @    #     $     %     ^     *     /     \     +    :    ;    |     <     >     ?    _  ,) from a STRING in sql
    select 'TESTING ! ABC 123 #'
    FROM DUAL;
    What is the best way to do it? Please provide examples also.

    What is your expected output... The query I posted just removes them, it never replaces them with spaces..your string already has space.. if you want to remove space as well .. try this...
    SELECT TRANSLATE ('TESTING ! ABC 123 #', '-~!@#$%^*/\+:;|<>?_, ', ' ') FROM DUAL;
    Output:
    --TESTINGABC123
    Else post your expected output..
    Cheers,
    Manik.

  • Can I edit the size of my photo when setting up an email signature?

    Can I edit the size of my photo when setting up an email signature?

    Not sure what you mean by "photo screen?" Do you mean your Photo Stream?
    In the Photos app there are several ways to view the photos. Tap on Albums. Your Photo Stream is one Album but there may be others including the Camera Roll, albums made on the iPad with photos from the Camera Roll, and albums of photos copied to your iPhone by syncing with your computer.
    To remove albums from the Camera Roll, tap on the Camera Roll album to see the small thumbnails of the photos there. Tap on Select, tap on the photos to delete, then tap on the trashcan. The photos will then be moved to another album called Recently Deleted. They remain there for 30 days to allow you time to reconsider whether you really want to delete them or not. After 30 days they will automatically be deleted from your iPhone. But if you are sure you want the photos deleted from your iPhone delete them again from the Recently Deleted album.
    Albums created on the iPad with photos from the Camera Roll can be deleted in the same way.
    To delete albums copied to your iPhone by syncing with your computer running iTunes are deleted by doing another sync. But before you click on Sync deselect the albums in iTunes. Then when you click on Apply or Sync the albums will be removed from your iPhone but they will remain on your computer.

  • Open File dialog window when setting the value of a path type input argument in a VI call

    Hi,
    I am new to TestStand (running 4.0) and I want to create a sequence of VIs to turn on, setup and measure a device. One of my VIs sends a configuration file to my device. An input argument to this VI is the path of the config file. I would like to make it simple to modify this path when setting up the sequence by popping up the File Open dialog window and choose my file. Is this possible? I do not want to manually change the file during execution, just to have multiple calls of one VI, each call opening a different file according to the path given to it during the setup. 
    So far I have only succeeded in manually entering the absolute path each time I add this step. What makes it even more annoying is the fact that LabVIEW interprets the path with the escape codes, rendering the path unusable. Manually adding a 2nd backslash at each '\' occurence adds another step to the process. I tried both String and Path type of inputs, and the SearchandReplace() or ToUpper() (trying to bypass the escape codes) functions in TestStand don't seem to help m.
    Your help is very much appreciated,
    Fred

    Eudaemonic,
    If you want to create a series of easy to configure step types so others can develop sequence files easily, you could use custom step types. When you create a custom step type you implement your own configuration dialog. Since you have control over what controls you expose in your configuration dialog, you can design it so the desired path is selected using a open file dialog. Refer to chapter 13 of the TestStand reference manual for more information about custom step types.
    If you do not want to create a custom step type but you still want to give access to your sequence developers to pre-configured steps, you can use templates. A step template is a snapshot of a step that you can reuse later. Let's assume that instead of asking your users to edit the step to enter the desired path, you create several step templates with different pre-configured paths and based on their applications requirements they could use the appropriate template. Refer to the NI TestStand Help for more information about the Templates list on the Insertion Palette.  
    Hope it helps.
    Antonio Lie. 

  • IPhone 5 skips the wifi set up when setting up from new

    My iPhone 5 skips setting up WiFi when setting up from new. I restored my iPhone because since I have owned it WiFi has not worked so I decided to do a restore to get it to go through the setup process but it skips it. Does this mean that the WiFi chip is faulty?

    Hi there wairau,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Wi-Fi settings grayed out or dim
    http://support.apple.com/kb/TS1559
    Resolution
    Follow these steps to resolve the issue:
    Restart your iOS device.
    Make sure that airplane mode is off by tapping Settings > Airplane Mode.
    Reset the network settings by tapping Settings > General > Reset > Reset Network Settings.
    This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings.
    Make sure that your device is using the latest software. To do so, connect your device to your computer and check for updates in iTunes.
    If you still can't turn Wi-Fi on, please contact Apple for support and service options. If you can turn Wi-Fi on but are experiencing other issues with Wi-Fi, see how to resolve those Wi-Fi issues.
    It sound like you have already tried all of these steps, so you may need to contact Apple for support and service options.
    -Griff W. 

  • Not printing full 6x4 when set to print 6x4 leaving at least 1/2" blank at the end answers please

    not printing full  6x4 when set to 6x4 leaving at least 1/2" at the ends un printed this is bad any answers to solve this problem please have tried looking on hp  but cannot find a answeer to the problem.

    Hi there,
    Could you provide the community with a little more information to help narrow troubleshooting? Things like your printer model and your operating system help out a lot.
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • When setting up iCloud for my Contacts, it wiped out my contact list from Outlook on my PC.  The contact list is on iCloud and on my iPad.  How do I get my contact list back on my PC?

    When setting up iCloud for my Contacts, it wiped out my contact list from my PC.  How do I get the contact list back in Outlook on my PC?

    It's in Outlook, in the iCloud account Contacts.

  • My original apple id is not an email address . I bought iCloud memory via that same account no problem. When setting up iCloud on iPad you cannot have a primary iCloud account unless it has an email address . Made new account but can you change originalI'

    My original apple id is not an email address .
    I bought iCloud memory via that same account no problem.
    When setting up iCloud on iPad you cannot have a primary iCloud account unless it has an email address .
    Made new account as per instruction ie [email protected] works fine
    BUT as I want to utilise the money spent on the additional memory it would be great to use the initial account set up as my primary HOWEVER as far as I have tried the initial apple ID CANNOT be changed. Bit confused actually any usefull guidance will be greatly appreciated. Thanks

    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    lmerchant wrote:
    My new phone has an old apple ID associated with iCloud only.  I cannot delete the account as it has "Find my iPhone" turned on. 
    Activation Lock in iOS 7  >  http://support.apple.com/kb/HT5818

  • I need to find out how to re-set icloud id on my iphone. I already had an apple id which is a family id. I used it as my id when setting up my new company phone. I have new apple id but can't change icloud phone. Still recognizes old id.

    I have a new company iphone. When setting it up I used a current "family" apple id I created for the children's itouch's. I realized after the fact that all of their contact/content dat is syncing to my business phone. I created a new apple id for the phone,logged out of the old id and in with the new on my phone. However, it will not allow me to make this same change for icloud on the phone. The icloud is still associated to the old id. How can I change my phone icloud to sync with my new apple id and stop getting the kids content?

    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")

  • When setting up my hubby's new phone to itunes, I have somehow merged the 2 itunes accounts together and now itunes is not responding to my phone and all of my info has synced onto my hubby's phone wiping all of his info and adding mine...Help!!

    I have an Itunes account already set up, when setting up my hubby's new phone to itunes, I have somehow merged the 2 itunes accounts together and now itunes is not responding to my phone and all of my info has synced onto my hubby's phone wiping all of his info and adding mine...Help!!

    If her data was not backed up or synced to something, it's gone. Sorry.

  • Changing SMTP Server Ports When Setting Up New Accounts

    My ISP, COX Communications, blocks port 25 for email accounts not using their SMTP servers. When setting up a mail account how do you change the port? I know how it's done when you have the account set up, but not when you're trying to set up the account.
    Note that I can think of a way to 'cheat', but having to 'cheat' doesn't sit well with me. It's a clutzy solution to a problem. Let people change ports during account set up should that prove necessary.

    HI, all you can do is let Mail go for however long it needs to after making the Account, (half hour here on both send/receive), before it figures out to continue, so you can get to the Advanced Tab!
    Or make the Account in say Eudora & Import it.

  • Never recvd verification code, in PHOTOMAIL dialog box it is asking for one when trying to email pictures,never saw any codes when setting this up

    verification code, never received it when setting up contacts to email pictures, in PHOTOMAIL dialog box it is asking for one to verify my email address and said it was sent to my email, went back and checked and there wasn't anything there, where is it or what do I need to do now????

    Does the account you are using have admin rights? I found this :
    http://support.apple.com/kb/HT2397
    +In Mac OS X 10.3 Panther and later, users with administrative privileges aren't prompted to change the region the very first time a DVD-Video disc of a single region is inserted. Instead, the region of the DVD drive is automatically set to the region of the DVD disc that was inserted. Accounts that don't have administrative privileges must authenticate with an administrator account name and password, because changing the drive's region code requires administrative privileges.+
    Sounds like it might be worth a try from an admin account first.

Maybe you are looking for