Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18513

When the save fail the UI shows "Server Error" instead of what the server sent with Tomcat 8.5+

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 12.10.5
    • None
    • Unknown

    Description

      In https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-12.10.5/xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/actionbuttons/actionButtons.js#L692 we expect the error message to be stored in the statusText. Problem is that Tomcat does not set it anymore since 8.5.0 with the following reason:

      RFC 7230 states that clients should ignore reason phrases in HTTP/1.1 response messages. Since the reason phrase is optional, Tomcat no longer sends it. As a result the system property org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER is no longer used and has been removed. (markt)

      I also noticed in https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText that it's not supported anymore in HTTP/2.

      All that combined suggest that we should stop using it at all. After all what you explicitly do on Java side is writing the error message in the HTTP body, so that's what we should expect.

      Note that it's not the only area affected by this problem, see https://github.com/xwiki/xwiki-platform/search?q=response.statusText+%3D%3D+%27%27

      Attachments

        Activity

          People

            Unassigned Unassigned
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: