-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content Security Policy error on redoc #764
Comments
It seems to be introduced by using |
There is another one, but it seems like just bundling e.exports=function(){var e=new Worker(URL.createObjectURL(new Blob(['!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=69)}([function(e,t,r){var n=r(24)("wks"),i=r(17),o=r(1).Symbol,s="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=s&&o[e]||(s?o:i)("Symbol."+e))}).store=n},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){var n,i;\n/**\n * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.5\n * Copyright (C) 2018 Oliver Nightingale\n * @license MIT\n */!function(){var o,s,u,a,c,l,f,h,d,p,y,v,m,g,x,w,S,b,k,P,Q,E,L,_,T,O,j=function(e){var t=new j.Builder;return t.pipeline.add(j.trimmer,j.stopWordFilter,j.stemmer),t.searchPipeline.add(j.stemmer),e.call(t,t),t.build()};j.version="2.3.5"\n/*!\n * lunr.utils\n * Copyright (C) 2018 Oliver Nightingale\n */,j.utils={},j.utils.warn=(o=this,function(e){o.console&&console.warn&&console.warn(e)}) |
It happens to me as well when I published the webapp under https. |
This looks strange. Maybe some specific header is set which leads to this behavior? Would be great, if you guys can investigate it. Thanks |
I think the problem might come from webpack, and to "fix" it, you can add the following to your header:
But I still believe this is a security concern, but I'll let other people chime in. |
@unional Any update already? I run into the exact same issue. |
No update. I'm still adding that header to get around this problem. |
From MDN:
Looks like your web server sets some specific CSP headers to Redoc javascript file which are then inherited by WebWorker preventing it to work. The proper solution is either to remove CSP headers from Redoc js file or to add
as @unional already figured out. |
I have tried the above solution which is adding "Content-Security-Policy: worker-src 'self' blob:" and somehow the server has some CSP rules which is getting the precedence. As per @RomanHotsiy comment i should the CSP header from ReDoc JS file. But where it is ? I can't see any predefined CSP rules inside the ReDoc JS files. |
Blob URLs may be disabled by CORS (ex: Redocly#764) but should not block execution when the disableSearch option is true
When I run a page on php using redoc@2.0.0-rc.0, It errors with the following:
The problem is caused by this:
Source:This might be a security concern that should be addressed.
EDIT: source is incorrect. Looking up the right code.
The text was updated successfully, but these errors were encountered: