Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-133772

As a System Admin, I can customize the HTTP response status code when inactive resources are requested




      Sites and Instances can be deactivated. When resources of a deactivated site/instance is requested, by default a 404 HTTP status code (not found) is responded. 

      Because 404 is also returned when non-existing resources are requested, it is not possible handle the response differently (e.g. the resource has been deactivated VS the resource does not exist).

      Acceptance Criteria

      Given a deactivated site/instance, when a custom HTTP response status code has been set under Inactive Request Handler, then any request to the site/instance return the defined HTTP response status.

      Other aspects:

      • Default code remains 404, to avoid breaking changes
      • The new input will only validate that the value is an integer of the accepted classes (see https://datatracker.ietf.org/doc/html/rfc7231#section-6), this is: 1xx, 2xx, 3xx, 4xx, 5xx)
      • Since RFC allows custom codes, further validation is not required. 

      Excerpt from RFC7231:

      HTTP status codes are extensible. HTTP clients are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable. However, a client MUST understand the class of any status code, as indicated by the first digit, and treat an unrecognized status code as being equivalent to the x00 status code of that class





            support-lep@liferay.com SE Support
            eduardo.garcia Eduardo García (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            0 Vote for this issue
            1 Start watching this issue




                Version Package