PageSourceSearch

https://my-js.org/assets/js/8c70aac1.57944f7e.js

js my-js.org collected 2026-10-05 17:57:57 UTC 23,217 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmy_js=globalThis.webpackChunkmy_js||[]).push([[30091],{8676(e,s,n){n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>t});const r=JSON.parse('{"id":"cheatsheet/cors","title":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors","description":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors","source":"@site/docs/cheatsheet/cors.md","sourceDirName":"cheatsheet","slug":"/cheatsheet/cors","permalink":"/docs/cheatsheet/cors","draft":false,"unlisted":false,"editUrl":"https://github.com/harryheman/my-js/tree/master/docs/cheatsheet/cors.md","tags":[{"inline":true,"label":"javascript","permalink":"/docs/tags/javascript"},{"inline":true,"label":"js","permalink":"/docs/tags/js"},{"inline":true,"label":"node.js","permalink":"/docs/tags/node-js"},{"inline":true,"label":"nodejs","permalink":"/docs/tags/nodejs"},{"inline":true,"label":"node","permalink":"/docs/tags/node"},{"inline":true,"label":"cors","permalink":"/docs/tags/cors"},{"inline":true,"label":"cross-origin resource sharing","permalink":"/docs/tags/cross-origin-resource-sharing"},{"inline":true,"label":"npm","permalink":"/docs/tags/npm"},{"inline":true,"label":"registry","permalink":"/docs/tags/registry"},{"inline":true,"label":"package","permalink":"/docs/tags/package"},{"inline":true,"label":"cheatsheet","permalink":"/docs/tags/cheatsheet"},{"inline":true,"label":"\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430","permalink":"/docs/tags/\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430"},{"inline":true,"label":"\u0440\u0435\u0435\u0441\u0442\u0440","permalink":"/docs/tags/\u0440\u0435\u0435\u0441\u0442\u0440"},{"inline":true,"label":"\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","permalink":"/docs/tags/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430"},{"inline":true,"label":"\u043f\u0430\u043a\u0435\u0442","permalink":"/docs/tags/\u043f\u0430\u043a\u0435\u0442"},{"inline":true,"label":"\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438","permalink":"/docs/tags/\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435-\u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432-\u043c\u0435\u0436\u0434\u0443-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438"}],"version":"current","sidebarPosition":22,"frontMatter":{"sidebar_position":22,"title":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors","description":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors","keywords":["javascript","js","node.js","nodejs","node","cors","cross-origin resource sharing","npm","registry","package","cheatsheet","\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430","\u0440\u0435\u0435\u0441\u0442\u0440","\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","\u043f\u0430\u043a\u0435\u0442","\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438"],"tags":["javascript","js","node.js","nodejs","node","cors","cross-origin resource sharing","npm","registry","package","cheatsheet","\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430","\u0440\u0435\u0435\u0441\u0442\u0440","\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","\u043f\u0430\u043a\u0435\u0442","\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438"]},"sidebar":"tutorialSidebar","previous":{"title":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e JSONWebToken","permalink":"/docs/cheatsheet/jsonwebtoken"},"next":{"title":"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Helmet","permalink":"/docs/cheatsheet/helmet"}}');var o=n(74848),c=n(28453);const i={sidebar_position:22,title:"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors",description:"\u0428\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u043f\u043e Cors",keywords:["javascript","js","node.js","nodejs","node","cors","cross-origin resource sharing","npm","registry","package","cheatsheet","\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430","\u0440\u0435\u0435\u0441\u0442\u0440","\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","\u043f\u0430\u043a\u0435\u0442","\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438"],tags:["javascript","js","node.js","nodejs","node","cors","cross-origin resource sharing","npm","registry","package","cheatsheet","\u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430","\u0440\u0435\u0435\u0441\u0442\u0440","\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430","\u043f\u0430\u043a\u0435\u0442","\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438"]},l="Cors",d={},t=[];function a(e){const s={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,c.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.header,{children:(0,o.jsx)(s.h1,{id:"cors",children:"Cors"})}),"\n",(0,o.jsxs)(s.blockquote,{children:["\n",(0,o.jsxs)(s.p,{children:[(0,o.jsx)(s.a,{href:"https://www.npmjs.com/package/cors",children:"Cors"})," - \u044d\u0442\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a (middleware) \u0434\u043b\u044f ",(0,o.jsx)(s.code,{children:"Express-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439"}),", \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 ",(0,o.jsx)(s.code,{children:"HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432"}),", \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 ",(0,o.jsx)(s.a,{href:"https://developer.mozilla.org/ru/docs/Web/HTTP/CORS",children:"CORS"})," (Cross-Origin Resource Sharing - \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430)."]}),"\n"]}),"\n",(0,o.jsx)(s.p,{children:(0,o.jsx)(s.em,{children:"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-bash",children:"yarn add cors\n# \u0438\u043b\u0438\nnpm i cors\n"})}),"\n",(0,o.jsx)(s.p,{children:(0,o.jsx)(s.em,{children:"\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f"})}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-js",children:"// \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c `CORS` \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\nconst express = require('express')\nconst cors = require('cors')\n\nconst app = express()\napp.use(cors())\n\napp.get('/users/:id', (_, res) => {\n  res.json({ msg: 'CORS \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432!' })\n})\n\nconst PORT = process.env.PORT || 3000\napp.listen(PORT, () => {\n  console.log(`CORS-\u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 ${PORT}`)\n})\n\n// \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c `CORS` \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\napp.get('/users/:id', cors(), (_, res) => {\n  res.json({ msg: 'CORS \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430!' })\n})\n\n// \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c `CORS`\nconst corsOptions = {\n  origin: 'https://example.com',\n  optionSuccessStatus: 200, // \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u0438 SmartTV\n}\n\napp.get('/users/:id', cors(corsOptions), (_, res) => {\n  res.json({ msg: 'CORS \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f example.com' })\n})\n"})}),"\n",(0,o.jsxs)(s.p,{children:["\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f ",(0,o.jsx)(s.code,{children:"CORS"}),":"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-js",children:"const whitelist = ['https://exmaple.com', 'https://another.org']\nconst corsOptions = {\n  origin: (origin, cb) => {\n    if (whitelist.indexOf(origin) > -1) {\n      cb(null, true)\n    } else {\n      cb(new Error('\u0417\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e CORS'))\n    }\n  },\n}\n\napp.get('/users/:id', cors(corsOptions), (_, res) => {\n  res.json({ msg: 'CORS \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0438\u0437 \u0431\u0435\u043b\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430' })\n})\n"})}),"\n",(0,o.jsxs)(s.p,{children:["\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438\u043b\u0438 REST-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c ",(0,o.jsx)(s.code,{children:"!origin"}),":"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-js",children:"const corsOptions = {\n  origin: (origin, cb) => {\n    if (whitelist.indexOf(origin) > -1 || !origin) {\n      cb(null, true)\n    } else {\n      cb(new Error('\u0417\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e CORS'))\n    }\n  },\n}\n"})}),"\n",(0,o.jsx)(s.p,{children:(0,o.jsxs)(s.em,{children:["\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 ",(0,o.jsx)(s.code,{children:"CORS"})," \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432"]})}),"\n",(0,o.jsxs)(s.p,{children:["\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 ",(0,o.jsx)(s.code,{children:"OPTIONS"}),". \u041f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u0442 ",(0,o.jsx)(s.code,{children:"GET/HEAD/POST"})," (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ",(0,o.jsx)(s.code,{children:"DELETE"}),"), \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438. \u
10414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f ",(0,o.jsx)(s.code,{children:"CORS"})," \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a ",(0,o.jsx)(s.code,{children:"OPTIONS"}),":"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-js",children:"app.options('/users/:id', cors())\napp.delete('/users/:id', cors(), (_, res) => {\n  res.json({ msg: 'CORS \u0432\u043a\u043b\u044e\u0447\u0435\u043d!' })\n})\n"})}),"\n",(0,o.jsxs)(s.p,{children:["\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c ",(0,o.jsx)(s.code,{children:"CORS"})," \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-js",children:"app.options('*', cors())\n"})}),"\n",(0,o.jsx)(s.p,{children:(0,o.jsx)(s.em,{children:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438"})}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"origin"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Access-Control-Allow-Origin",children:(0,o.jsx)(s.code,{children:"Access-Control-Allow-Origin"})}),". \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:","\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"boolean"})," - ",(0,o.jsx)(s.code,{children:"false"})," \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ",(0,o.jsx)(s.code,{children:"CORS"}),", ",(0,o.jsx)(s.code,{children:"true"})," \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0434\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ",(0,o.jsx)(s.code,{children:"req.header('Origin')"})]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"string"})," - \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ",(0,o.jsx)(s.code,{children:"CORS"})," \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"regexp"})," - \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ",(0,o.jsx)(s.code,{children:"CORS"})," \u0434\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"array"})," - \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 ",(0,o.jsx)(s.code,{children:"CORS"}),"\u0434\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"function"})," - \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f ",(0,o.jsx)(s.code,{children:"CORS"}),". \u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e - \u043a\u043e\u043b\u0431\u0435\u043a \u0432 \u0432\u0438\u0434\u0435 ",(0,o.jsx)(s.code,{children:"(error: object, allow: boolean) => void"})]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"methods"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Access-Control-Allow-Methods",children:(0,o.jsx)(s.code,{children:"Access-Control-Allow-Methods"})}),". \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"allowedHeaders"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Access-Control-Allow-Headers",children:(0,o.jsx)(s.code,{children:"Access-Control-Allow-Headers"})}),". \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"exposedHeaders"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers",children:(0,o.jsx)(s.code,{children:"Access-Control-Expose-Headers"})}),". \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438. \u
1041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"credentials"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials",children:(0,o.jsx)(s.code,{children:"Access-Control-Allow-Credentials"})}),". \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"maxAge"})," - \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a ",(0,o.jsx)("a",{href:"https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/Access-Control-Max-Age",children:(0,o.jsx)(s.code,{children:"Access-Control-Max-Age"})}),". \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"preflightContinue"})," - \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 CORS-\u043e\u0442\u0432\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443"]}),"\n",(0,o.jsxs)(s.li,{children:[(0,o.jsx)(s.code,{children:"optionsSuccessStatus"})," - \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441-\u043a\u043e\u0434 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 ",(0,o.jsx)(s.code,{children:"OPTIONS"})," (\u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u0430\u0440\u044b\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432)"]}),"\n"]}),"\n",(0,o.jsx)(s.p,{children:"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-json",children:'{\n  "origin": "*",\n  "methods": "GET,HEAD,PUT,PATCH,POST,DELET
1E",\n  "preflightContinue": false,\n  "optionsSuccessStatus": 204\n}\n'})})]})}function h(e={}){const{wrapper:s}={...(0,c.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},28453(e,s,n){n.d(s,{R:()=>i,x:()=>l});var r=n(96540);const o={},c=r.createContext(o);function i(e){const s=r.useContext(c);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function l(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(c.Provider,{value:s},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.