Project

General

Profile

Actions

Support #23093

open

News & Views problem

Added by Marilyn Weber 4 months ago. Updated 4 months ago.

Status:
New
Priority name:
Normal
Assignee:
-
Category name:
Server
Target version:
Start date:
2025-07-30
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

From Stephen Klein
Digital Services Librarian
CUNY Graduate Center

We're seeing these errors:

Computers are not displaying the News & Views (this is fed from the Commons (https://gclibrary.commons.gc.cuny.edu/). on the library homepage (https://library.gc.cuny.edu/). in Firefox (it works in Chrome). Poking around, Steve Z saw this:

CORS header 'Access-Control-Allow-Origin' missing

This is a Commons issue, (Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://gclibrary.commons.gc.cuny.edu/category/blog/website-front-page/feed/?fsk=5c1146bca3512. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).)

Actions #1

Updated by Raymond Hoh 4 months ago

  • Category name set to Server
  • Target version set to Not tracked

Marilyn, the News and Views portion of the GC Library site should be working in Firefox now.

Boone, I've addressed this with the following .htaccess rules in wp-config.php:

<If "%{REQUEST_URI} =~ m#/feed/#">
  Header always set Access-Control-Allow-Origin "*" 
  Header always set Access-Control-Allow-Headers "user-agent" 
</If>

I'm only setting these CORS headers if the URL matches /feed/, which probably isn't the best technique here. If we would prefer to address this at the Litespeed level with Reclaim, then we can do that instead.

Actions #2

Updated by Boone Gorges 4 months ago

Thanks, Ray. This approach actually seems OK to me, as we generally want to treat /feed/ endpoints as publicly-consumable information (like an API endpoint).

Actions #3

Updated by Marilyn Weber 4 months ago

Thanks!

Actions

Also available in: Atom PDF