• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CORS AJaX GET

LEGEND ,
Jul 12, 2018 Jul 12, 2018

Copy link to clipboard

Copied

Hello, all,

I was just wondering if anyone has successfully accomplished a CORS via AJaX by setting the "Access-Control-Allow-Origin" header to either wildcard (*) or FQDN (www.anothersite.com)?

I found a claim that I can use a CFHEADER tag to set the Access-Control-Allow-Origin and complete a cross-origin request. I was just wondering if anyone else has successfully done the same thing (regardless of server-side language).

V/r,

^ _ ^

Views

471

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 12, 2018 Jul 12, 2018

Welp.. I found my answer.  "DENY".  Webserver is set to disallow, so even including the special header "Access-Control-Allow-Origin" will not work. 

My job can sometimes be like herding cats.

V/r,

^ _ ^

Votes

Translate

Translate
Community Expert ,
Jul 12, 2018 Jul 12, 2018

Copy link to clipboard

Copied

I've done this in .NET. I would assume it would also work in CF, but don't remember testing it recently.

Dave Watts, Fig Leaf Software

Dave Watts, Eidolon LLC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 12, 2018 Jul 12, 2018

Copy link to clipboard

Copied

I don't know what I'm doing incorrectly, but I can't get it to work.  Looking at the header info, it still shows my staging FQDN as the origin, and nothing about Access-Control-Allow-Origin is present (viewing in DevTools.)

Is it possible that a webserver can be set so that a CF server cannot alter the header in question?

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 12, 2018 Jul 12, 2018

Copy link to clipboard

Copied

LATEST

Welp.. I found my answer.  "DENY".  Webserver is set to disallow, so even including the special header "Access-Control-Allow-Origin" will not work. 

My job can sometimes be like herding cats.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation