OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Firebase being blocked by CORS headers

  • Thread starter Thread starter hugger
  • Start date Start date
H

hugger

Guest
I need to apply the following CORS headers so I can use sharedArrayBuffer which is required by FFMPEG.

Code:
<IfModule mod_headers.c>
     Header set Cross-Origin-Embedder-Policy "require-corp"
     Header set Cross-Origin-Opener-Policy "same-origin"
</IfModule>

With this code in my .htaccess I am able to use sharedArrayBuffer (great) but now I cannot load data from firebase, it is blocked.

Code:
net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 (OK)

I have tried creating a cors.json to allow firebase storage, but it still does not work.

Code:
[
  {
    "origin": ["https://mydomain.io"],
    "responseHeader": ["Content-Type", "Authorization"],
    "method": ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS"],
    "maxAgeSeconds": 3600
  }
]

I also tried to apply the headers only on the /register route which is where I need the headers applied, but it still does not work even though if i do a curl request to that url it shows the headers are set?

I am very confused and not too familiar with writing code on the server with .htaccess, but I've not been able to crack this after many days of trying.

I hope someone can guide me the right direction!
<p>I need to apply the following CORS headers so I can use sharedArrayBuffer which is required by FFMPEG.</p>
<pre><code><IfModule mod_headers.c>
Header set Cross-Origin-Embedder-Policy "require-corp"
Header set Cross-Origin-Opener-Policy "same-origin"
</IfModule>
</code></pre>
<p>With this code in my .htaccess I am able to use sharedArrayBuffer (great) but now I cannot load data from firebase, it is blocked.</p>
<pre><code>net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 (OK)
</code></pre>
<p>I have tried creating a cors.json to allow firebase storage, but it still does not work.</p>
<pre><code>[
{
"origin": ["https://mydomain.io"],
"responseHeader": ["Content-Type", "Authorization"],
"method": ["GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS"],
"maxAgeSeconds": 3600
}
]
</code></pre>
<p>I also tried to apply the headers only on the /register route which is where I need the headers applied, but it still does not work even though if i do a curl request to that url it shows the headers are set?</p>
<p>I am very confused and not too familiar with writing code on the server with .htaccess, but I've not been able to crack this after many days of trying.</p>
<p>I hope someone can guide me the right direction!</p>
Continue reading...
 

Latest posts

A
Replies
0
Views
1
Alvah_Franey
A
H
Replies
0
Views
1
habrewning
H
Top