Problem/Motivation

Install standard profile.
Create a 'page' node.
Log out and visit node/1
Check network tab of your browser dev tools.
See a 403 POST request to history/1/read

Proposed resolution

Don't add the history js for anonymous users.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#4 2500977-4.patch2.03 KBolli
#4 2500977-4-test.patch584 bytesolli
#1 2500977-1.patch1.46 KBolli

Comments

olli’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.46 KB

Adding a cache context seems to help.

berdir’s picture

Issue tags: +D8 cacheability

Nice. This was caused by the removal of adding that context by default for caching rendered entities. And #2493033: Make 'user.permissions' a required cache context would ensure that things like this are less likely to happen. Except when your anonymous and authenticated users have exactly the same permissions ;)

Still makes sense to fix this anyway of course.

berdir’s picture

Test should be easy, on a page that adds this, do an assertCacheContext() for this context.

olli’s picture

StatusFileSize
new584 bytes
new2.03 KB
berdir’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Yes, like that. RTBC if bot agrees.

The last submitted patch, 4: 2500977-4-test.patch, failed testing.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 2b20dd2 on 8.0.x
    Issue #2500977 by olli: History module triggers a post request for...

Status: Fixed » Closed (fixed)

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

rhsantos’s picture

Hello,

I think this issue still happens with drupal 8.8.5
I´m having trouble with ldap_sso plugin. I have activated module mod_authn_ntlm in my apache instance. Everything seemed to work properly in Drupal, except nodes. Views are properly seen for example. But when I access a node then I have an unauthorized access, even if I´m logged in as root.

As user I receive the following errors in Apache:
[Tue Apr 07 10:08:37.229231 2020] [authz_user:debug] [pid 18540:tid 1644] mod_authz_user.c(77): [client ::1:49909] AH01663: access to /intraceh/index.php/es/history/36/read failed, reason: user 'CEDEXINT\\rhsantos' does not meet 'require'ments for user to be allowed access, referer: http://localhost:9090/intraceh/index.php/es/FlujoContratoMenor

Debugging with Google Chrome it says it is a POST request. When I launch the same request directly throug Chrome it is a GET request and it is properly shown (just a number). Here it is the object that fails to download:
Request URL: http://ceh-pxi-05.interno.cedex.es:9090/intraceh/es/history/36/read
Request Method: POST
Status Code: 401 Unauthorized
Remote Address: XXX.xxx.XXX.xxx:9090
Referrer Policy: no-referrer-when-downgrade

If you think this is another problem, please feel free to tell me. Or tell me how to debug it.
Thanks anyway,
Regards, Ricardo