CORS Flashcards

1
Q

What does CORS stand for?

A

Cross-Origin Resource Sharing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is CORS?

A

CORS is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You load a React app from www.domain1.com.
Then you make requests using JS and fetch to the same domain.
Do you need to consider CORS?

A

No as you are sending requests to the original domain you don’t need to worry about CORS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You load a React app from www.domain1.com.
Then you make requests using JS and fetch to www.domain2.com
Do you need to consider CORS?

A

Yes, as you are sending requests to a different domain than where you retrieved the React app from www.domain2.com will need to send the correct CORS headers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What defines the origin?

A

The main request made for a web page. For a React app it would be getting the index.html. (I assume)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A request is sent via JS with these headers, where is the request being sent to and from?
Host: oneedfhirtest.azurewebsites.net
Origin: http://localhost:3000

A

The request is being sent to the server oneedfhirtest.azurewebsites.net
from the application that was loaded from http://localhost:3000.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly