Bitcoin Forum

Other => Meta => Topic started by: Pmalek on December 11, 2020, 11:00:17 AM



Title: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: Pmalek on December 11, 2020, 11:00:17 AM
I am not sure if this new error is somehow related to the changes theymos did because of the Small bug with the highlighting of forum subjects/thread titles.  (https://bitcointalk.org/index.php?topic=5298598.0) But every time I type a certain sub-forum in the Chrome search bar, I am getting the same error.

Quote
You don't have authorization to view this page.
HTTP ERROR 403
I made two screenshots to show what happens when I enter Meta in the browser. You can't replicate this error by going to a particular sub from the forum directly. You have to spell it out in your browser. The error is present in Chrome, I couldn't replicate it in Firefox. The HTTP error is triggered only once, if you make the same search a 2nd time, it works just fine. It happens when searching for other sub-boards as well.

1.

https://i.imgur.com/YLj2LS1l.png

2.

https://i.imgur.com/7nY7sC6l.png

 


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: jackg on December 11, 2020, 12:13:20 PM
I can't reproduce it, are you still getting it or is it fixed now?

Mightve just been a server/Browser cache issue or something.


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: mole0815 on December 11, 2020, 12:50:44 PM
It also works correctly for me.
To 99% one of these 3 variants will help.
- disable (new) plugins/addons for test purposes
- clear cache
- restart browser

I think this should be enough to make it work again :)


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: NeuroticFish on December 11, 2020, 02:30:27 PM

I'll also add logoff + log in to the list.
And a remark at restart browser: also check with task manager it was actually stopped and not hanging.

Sometimes Chrome or some of its extensions used to handle cookies in a strange manner for me too leading to strange issues.
But I don't use Chrome as main browser, so I don't know if that's the case here.


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: Pmalek on December 12, 2020, 08:54:54 AM
To 99% one of these 3 variants will help.
- disable (new) plugins/addons for test purposes
I don't like plugins or addons and besides those privacy-related, I don't think I have installed more than a couple in my life.   

- clear cache
I don't want to lose my browsing history. ;D

theymos either worked his magic again or it got fixed by itself. I am no longer able to reproduce the same errors from yesterday.



Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: theymos on December 12, 2020, 12:41:38 PM
I am not sure if this new error is somehow related to the changes theymos did because of the Small bug with the highlighting of forum subjects/thread titles.  (https://bitcointalk.org/index.php?topic=5298598.0)

It was. In addition to prefetching links on the page you're looking at, Chrome apparently prefetches URLs it suggests in the URL bar before you actually visit them. I fixed the previous issue of unwanted prefetch side-effects by returning 403 errors to all prefetch requests, but Chrome was then actually remembering that error and returning it if you actually visited the URL.

For any other developers dealing with this problem, here's what seems so far to work:
 - On pages where you don't want to allow prefetching, go through all of the request headers and see if any of them equal "prefetch". The main one seems to be Purpose: prefetch, but there seem to be at least 3 different headers, which is why I'm just scanning through all headers.
 - Return an error if it's a prefetch, along with a Cache-Control: no-store header so that the error isn't returned if the user actually visits the page.


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: NotATether on December 12, 2020, 02:11:53 PM
For any other developers dealing with this problem, here's what seems so far to work:
 - On pages where you don't want to allow prefetching, go through all of the request headers and see if any of them equal "prefetch". The main one seems to be Purpose: prefetch, but there seem to be at least 3 different headers, which is why I'm just scanning through all headers.
 - Return an error if it's a prefetch, along with a Cache-Control: no-store header so that the error isn't returned if the user actually visits the page.

That's probably No-State prefetch you were blocking. I read in the release notes (https://developers.google.com/web/updates/2018/07/nostate-prefetch) that "Purpose: prefetch" was added in Chrome 69. Odd for this problem to crop up just now, or maybe it had silently existed all these months and nobody noticed.

Two bug reports were filed on Chromium a few months (years in the case of the second bug) before that complaining that prefetch requests were identical to normal requests and had no distinguishing headers back then (796738 (https://bugs.chromium.org/p/chromium/issues/detail?id=796738) and 86175 (https://bugs.chromium.org/p/chromium/issues/detail?id=86175)), where you can actually see users and developers arguing about why they're not sending a header although it was easy to make it do so. I'm glad they finally got things sorted out.


Title: Re: I am getting a HTTP ERROR 403 when typing a certain sub-forum in the browser
Post by: Pmalek on December 14, 2020, 07:37:25 AM
Snip
Cheers theymos! Just like with the other thread where I reported an error, I will leave this topic open for a little bit just in case the same issues pop back up for me or for some other users. If nothing changes, I will lock it soon.