Bug 533054 - exceptions ignore xml output parameter
Summary: exceptions ignore xml output parameter
Keywords:
Status: CLOSED EOL
Alias: None
Product: Dogtag Certificate System
Classification: Retired
Component: Certificate Manager
Version: 1.2
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: RHCS Maintainers
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: freeipa20 ipa-fixes
TreeView+ depends on / blocked
 
Reported: 2009-11-04 20:25 UTC by John Dennis
Modified: 2020-03-27 20:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:05:47 UTC
Embargoed:


Attachments (Terms of Use)
patch (1.00 KB, patch)
2009-11-12 16:07 UTC, John Dennis
no flags Details | Diff

Description John Dennis 2009-11-04 20:25:28 UTC
When a request is sent to the CMS server it can specify it wants an xml document as the result as opposed to HTML by setting the HTTP request arg xml=true.

In CMSServlet.renderTemplate() the xml flag is checked and if its set to true then it invokes CMSServlet.outputXML() instead of rendering an HTML template.

However CMSServlet.renderTemplate() is bypassed when an exception is caught. Instead in the exception catch block CMSServlet.renderExecption() is directly invoked bypassing the logic in CMSServlet.renderTemplate(). 

CMSServlet.renderExecption() fails to test for the xml output flag, as a consequence even though the client requested xml output instead of HTML, it gets HTML, a truly unanticipated response.

Comment 1 John Dennis 2009-11-12 16:07:18 UTC
Created attachment 369245 [details]
patch

Comment 2 Andrew Wnuk 2009-11-18 19:02:58 UTC
Did you intentionally ignore "xmlOutput" request parameter to provide XML output only if "xml" request parameter is set to true?

If no, then you are ignoring your own algorithm provided in bug #531940.
     (see: https://bugzilla.redhat.com/attachment.cgi?id=369228)
If yes, then your patch is fine.

Comment 3 John Dennis 2009-11-18 19:11:34 UTC
re comment #2 yes this was intentional. The use of "xmlOutput" parameter name is a singular aberration unique to profileSubmit, all other usage is consistently "xml". I'd be happy to see the xmlOutput exception eliminated for consistency sake but I assumed it was important to retain for backward compatibility reasons. Since IPA will have it's own branch perhaps this isn't valid rationale. If these patches make it back into the main CMS code base then this would be an issue.

Comment 4 Andrew Wnuk 2009-11-25 23:45:52 UTC
Patch included in in bug #533979 (attachment #373874 [details]) is committed.


Note You need to log in before you can comment on or make changes to this bug.