Custom Header not working in the any additional pages - CORS error

1161
3
11-06-2017 01:28 AM
by Anonymous User
Not applicable

Hello,

We have a problem with the open data site whereby the custom header we have is not replicated in the additional pages feature of the website. The custom header in the site http://geoportal.statistics.gov.uk/ works fine but it doesn't work in any additional pages such as http://geoportal.statistics.gov.uk/pages/news-and-updates - this is because the custom css is being blocked by the browser for the reasons -

We use a custom domain name - geoportal.statistics.gov.uk and XHR requests to / for the opendata.css.txt file, which contains the sites custom CSS, are apparently being blocked by browsers when the site uses a custom domain name. It’s due to the client request missing the Origin header and the server response missing the Access-Control-Allow-Origin header [home-page-custom-css-CORS-error.png]. These headers are actually being included on a second cloned test site that we have set up that does not use a custom domain name [test-site-CORS-included.png].

We’ve also noticed that the sites custom CSS is being included inline within the <head> on the home page [home-page-custom-css-inline.png], however it is not included on child pages [page-missing-custom-inline.png].

Thanks

Matt (ONS Geography)

­­

0 Kudos
3 Replies
by Anonymous User
Not applicable

Is it possible to allow the custom css through to the child pages either inline in the <head> of the child pages.

At the moment the client request is missing the Origin header and the server response is missing the Access-Control-Allow-Origin header for our custom domain site which means it screws up our custom header in our child pages.

0 Kudos
by Anonymous User
Not applicable

Any help gratefully received

Thanks

Matt

0 Kudos
by Anonymous User
Not applicable

This looks like a bug. We'll get one created and inform you of any updates

0 Kudos