Bug #77802 [Com]: PHP website CORS problem
| From: | php4fan at gmail dot com | Date: | Mon, 29 Apr 2019 18:12:05 +0000 |
| Subject: | Bug #77802 [Com]: PHP website CORS problem | ||
| References: | 1 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-27983@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77802&edit=1
ID: 77802
Comment by: php4fan at gmail dot com
Reported by: tietew at gmail dot com
Summary: PHP website CORS problem
Status: Assigned
Type: Bug
Package: Website problem
PHP Version: Irrelevant
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
> The home page https://php.net/ does NOT redirect to
> https://www.php.net
Actually, it's worse than that.
There's NO REDIRECT WHATSOEVER.
No php.net page redirects to its www.php.net counterpart. It's just all the links within the
page point to www., so if you follow one link you will be in the right place. But you can access any
page without the www and you won't be redirected, but it will be broken.
Quite pathetic.
Previous Comments:
------------------------------------------------------------------------
[2019-04-29 18:06:28] php4fan at gmail dot com
Apparently this had been fixed, but now it's back the other way around.
The home page https://php.net/ does NOT redirect to https://www.php.net (it should). So, the autocomplete for the search
box works for most pages, but not for the home page at https://php.net/ because it does the request to https://www.php.net/
The solution is three-fold (I think any of these alone would fix the issue, but ALL three should be
done):
1. Have https://php.net/ redirect to https://www.php.net and make sure there are no other pages besides
the index that forget to redirect.
2. Instead of loading from "https://www.php.net/whatever", load from
"/whatever"
3. Set up your CORS policy properly. Both php.net and www.php.net should list both php.net and
www.php.net as allowed origins.
------------------------------------------------------------------------
[2019-04-24 08:57:50] tietew at gmail dot com
Once problem was solved. But now, a different error occurs.
Access to XMLHttpRequest at 'https://www.php.net/js/search-index.php?lang=en'
from origin 'https://php.net' has been blocked by CORS
policy: Response to preflight request doesn't pass access control check: The
'Access-Control-Allow-Origin' header has a value 'http://php.net' that is not equal to the supplied origin.
------------------------------------------------------------------------
[2019-03-29 18:35:37] requinix@php.net
Related To: Bug #77824
------------------------------------------------------------------------
[2019-03-27 08:15:47] salathe@php.net
Assigning to Derick since he has been leading the recent changes for the website.
------------------------------------------------------------------------
[2019-03-27 05:02:15] tietew at gmail dot com
Description:
------------
---
From manual page: hhttps://www.php.net/manual/en/index.php
---
Chrome 73 reported following error in dev console and incremental search does not work.
Access to XMLHttpRequest at 'https://php.net/js/search-index.php?lang=en'
from origin 'https://www.php.net' has been blocked
by CORS policy: Response to preflight request doesn't pass access control check: Redirect is
not allowed for a preflight request.
php.net is now redirected to www.php.net, but Ajax request is still sent to php.net.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77802&edit=1