After upgrading my Drupal installation to 10.1.x CSS/JS aggregation no longer seemed to work. After some research it appears Anonymous Redirect is instructing a redirect for the sites/default/files/js/* and sites/default/files/css/* paths.

Unsure, but might be related to the changes in #2888767: Asset aggregation deprecations and additions, hook_js_alter()/hook_css_alter() changes?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rp7 created an issue. See original summary.

rp7’s picture

Assigned: rp7 » Unassigned
Status: Active » Needs review
StatusFileSize
new4.05 KB

MR opened + patch attached.

mstrelan’s picture

Status: Needs review » Needs work

Left some nits and a question about compatibility. Test coverage would be good if possible.

rp7’s picture

StatusFileSize
new6.16 KB

Made a few proposed changes + tried to get the tests green.
A test for an actual asset generation path should still be added, though.

mstrelan’s picture

Needs a rebase

mstrelan’s picture

Status: Needs work » Needs review

Rebased and started looking at test coverage, but one glaring issue is that the asset generation directory by default is the same as the public file system. This might be ok though, since it's usually served directly by apache anyway, except for the image styles directory.

fmb’s picture

Status: Needs review » Reviewed & tested by the community

We have been using this fix for a few months, and it works well.

jimmynash’s picture

This fix has been working for us as well.

  • mstrelan committed 6981e119 on 8.x-2.x authored by rp7
    fix: #3444326 Don't redirect on asset generation paths
    
    By: rp7
    By:...
mstrelan’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.