Method to bypass redirection

Created on 5 May 2023, about 2 years ago

Problem/Motivation

If a site is implementing a RestResource, the responses are affected negatively (returning a 404 when a 403 with a message is expected).

Steps to reproduce

Proposed resolution

Add configuration to disable the redirection on a set of paths

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Albert Volkman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Albert Volkman
  • Status changed to Needs review about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States hotwebmatter Providence, Rhode Island, USA

    This seems correct.

    I will note, however, that the behavior appears to be sticky until caches are cleared.

    So ... either invalidate caches for the specified routes when config is saved, or take the lazy route and add some text saying "Rebuild caches after saving configuration."

    Does that make sense?

  • πŸ‡ΊπŸ‡ΈUnited States Albert Volkman

    @hotwebmatter nice catch! Latest commit should handle that.

  • Status changed to RTBC about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States hotwebmatter Providence, Rhode Island, USA

    Tested Merge request !3

    With unpatched module, http://d9.lndo.site/admin/config/system/m4032404 is redirected to 404, whether or not the "Enforce on Admin Only" boolean is set TRUE.

    After applying patch, if no Pages are specified, the default behavior remains the same, and http://d9.lndo.site/admin/config/system/m4032404 is redirected to 404, whether or not the "Enforce on Admin Only" boolean is set TRUE.

    After specifying /admin/config/system/m4032404 in Pages, the following behavior occurs:

    • When "Redirect the above paths to 404" radio button is selected:
      $ wget --spider http://d9.lndo.site/admin/config/system/m4032404
      Spider mode enabled. Check if remote file exists.
      --2023-05-09 18:12:29--  http://d9.lndo.site/admin/config/system/m4032404
      Resolving d9.lndo.site (d9.lndo.site)... 127.0.0.1
      Connecting to d9.lndo.site (d9.lndo.site)|127.0.0.1|:80... connected.
      HTTP request sent, awaiting response... 404 Not Found
      Remote file does not exist -- broken link!!!
    • When "Do not redirect the above paths to 404" radio button is selected:
      $  wget --spider http://d9.lndo.site/admin/config/system/m4032404
      Spider mode enabled. Check if remote file exists.
      --2023-05-09 18:12:40--  http://d9.lndo.site/admin/config/system/m4032404
      Resolving d9.lndo.site (d9.lndo.site)... 127.0.0.1
      Connecting to d9.lndo.site (d9.lndo.site)|127.0.0.1|:80... connected.
      HTTP request sent, awaiting response... 403 Forbidden
      Remote file does not exist -- broken link!!!

    Reviewed and tested by the community.

  • First commit to issue fork.
  • πŸ‡¦πŸ‡ΊAustralia elc

    If this patch was used on a production site, it will need the update introduced in πŸ“Œ Method to bypass redirection (Temporary) Active

Production build 0.71.5 2024