<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/B2DEwY-13" -->

---
title: What is CORS? | daily.dev
description: Cross-Origin Resource Sharing (CORS) is an HTTP-based security mechanism controlled and enforced by the client. It allows a service to indicate any origin...
canonical: https://daily.dev/posts/what-is-cors--b2dewy-13
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What is CORS? | daily.dev
og:description: Cross-Origin Resource Sharing (CORS) is an HTTP-based security mechanism controlled and enforced by the client. It allows a service to indicate any origin...
og:url: https://daily.dev/posts/what-is-cors--b2dewy-13
og:image: https://api.daily.dev/og/posts/B2DEwY-13.png
og:image:alt: What is CORS?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What is CORS?

**[DEV](https://daily.dev/sources/devto)** · 8 min read · 175 upvotes · 13 comments

## Summary

Cross-Origin Resource Sharing (CORS) is an HTTP-based security mechanism controlled and enforced by the client. It allows a service to indicate any origin other than its own from which the client can request resources. A request may be blocked by CORS policy not only because of the incorrect origin, but also incorrect HTTP header, HTTP method or Cookie header. How to fix CORS error?

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/jpomykala/what-is-cors-11kf>

## Community discussion

Top comments from developers on daily.dev.

**@arc9** · 5 upvotes

> Ahhhhh... CORS... my arch-nemesis!

**@ebuz** · 3 upvotes

> It's still a nightmare for me.

**@veyselaksin** · 0 upvotes

> I need to know this :)

**@pavlicko** · 0 upvotes

> SO many pages to check on old sites. ughhh

**@jodyson24** · 0 upvotes

> Thanks

---

Tags: [#api-gateway](https://daily.dev/tags/api-gateway), [#google-chrome](https://daily.dev/tags/google-chrome), [#web-security](https://daily.dev/tags/web-security)

[View this post on daily.dev](https://daily.dev/posts/what-is-cors--b2dewy-13)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What is CORS?","url":"https://daily.dev/posts/what-is-cors--b2dewy-13","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-is-cors--b2dewy-13"},"datePublished":"2022-10-19T05:54:32.070Z","dateModified":"2023-03-21T02:16:52.939Z","description":"Cross-Origin Resource Sharing (CORS) is an HTTP-based security mechanism controlled and enforced by the client. It allows a service to indicate any origin...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/76f618ed718b864f09363fbc4ba52065","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/76f618ed718b864f09363fbc4ba52065","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":13,"discussionUrl":"https://daily.dev/posts/what-is-cors--b2dewy-13","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":175},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":13}],"keywords":"api-gateway,google-chrome,web-security","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"What is CORS?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/what-is-cors--b2dewy-13","comment":[{"@type":"Comment","text":"Ahhhhh… CORS… my arch-nemesis!","datePublished":"2022-10-19T13:24:08.158Z","url":"https://daily.dev/posts/B2DEwY-13#c-nKT_Ujdcd","author":{"@type":"Person","name":"Brad Kuentzel","url":"https://daily.dev/arc9","image":"https://avatars.githubusercontent.com/u/68611130?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5}},{"@type":"Comment","text":"It’s still a nightmare for me.","datePublished":"2022-10-23T14:44:27.183Z","url":"https://daily.dev/posts/B2DEwY-13#c-z4AFt-8w2","author":{"@type":"Person","name":"Taki Elias","url":"https://daily.dev/ebuz","image":"https://media.daily.dev/image/upload/v1667280113/avatars/avatar_WPc7MkTKlK9IHPGFzkjfv.jpg"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"I need to know this :)","datePublished":"2022-10-30T08:58:59.647Z","url":"https://daily.dev/posts/B2DEwY-13#c-Y5ebiJli7","author":{"@type":"Person","name":"Veysel Aksin","url":"https://daily.dev/veyselaksin","image":"https://lh3.googleusercontent.com/a-/ACNPEu8YdFSiMqRw9ht6X7e47KXJ1ephJLJ7EU2IYV_FcA=s100"}},{"@type":"Comment","text":"SO many pages to check on old sites. ughhh","datePublished":"2022-10-24T19:22:43.906Z","url":"https://daily.dev/posts/B2DEwY-13#c-4Ab0pQRlt","author":{"@type":"Person","name":"David Pavlicko","url":"https://daily.dev/pavlicko","image":"https://avatars.githubusercontent.com/u/5881821?v=4"}},{"@type":"Comment","text":"Thanks","datePublished":"2022-10-21T00:33:29.209Z","url":"https://daily.dev/posts/B2DEwY-13#c-iokjI1NUG","author":{"@type":"Person","name":"J Ade","url":"https://daily.dev/jodyson24","image":"https://lh3.googleusercontent.com/a-/AFdZucrppH0cNom8r3zky31hDHRnoq7elHYn9i_EgJD8NQ=s100"}}]}
```

