I'm finally done. I automated my home with 30+ smart home gadgets.
Sensors are everywhere—all across the farm. I feel like a crazy person.
My most clever home automations so far:
Here are some whitepapers that you must read [as a senior engineer].
20. TikTok Monolith
19. Meta FlexiRaft
18. Google Spanner
17. Meta Minesweeper
16. Apache Cassandra
15. Apple FoundationDB
14. Amazon AuroraDB
13. Google Pregel
12. Google Dapper
11. Google Chubby
API architectural styles are one of key factors behind seamless applications.
Tomorrow thousands of subscribers will learn about the most prominent API architectural styles.
Join us to get the issue: https://t.co/pVm7JLY5Rf
How does CORS work?
Web browsers use Cross-Origin Resource Sharing (CORS) to manage requests made to a different domain than the one serving the web page. It's a security mechanism to mitigate the risks of cross-site request forgery and other cross-site attacks.
To get a clear picture of how it works, let’s break down the CORS workflow:
1) Initiation of a request from a web page
The process starts with a web page (origin A) trying to access a resource of a different origin (origin B).
2) “Simple” or “non-simple” request check
Before initiating the actual request, the browser checks if the request is "simple" or "non-simple". A "simple" request typically includes methods like GET, POST, or HEAD and a limited set of headers. If the request is "non-simple", the browser initiates a preflight request.
3) Preflight request (for non-simple requests)
After the browser has completed its “non-simple” request check, if the request is “non-simple”, it will send an OPTIONS request to the target origin (origin B). The headers included will provide details of the actual request it wants to make. These headers include:
🔸 Origin: The origin of the calling script.
🔸 Access-Control-Request-Method: The HTTP method of the actual request.
🔸Access-Control-Request-Headers: Any custom headers that the actual request will send.
4) Server response to preflight request
Once the server (origin B) receives the preflight request, it will send a response. If the server decides that the origin is allowed to access the resource, it will respond with the following headers:
🔹 Access-Control-Allow-Origin: Specifies which origins are allowed. This can be a specific origin or a wildcard *.
🔹 Access-Control-Allow-Methods: Specifies which HTTP methods are allowed.
🔹 Access-Control-Allow-Headers: Specifies which HTTP headers can be used.
The browser will reject the actual request if the server doesn't provide the right headers or if those headers don't match the details of the request itself.
5) The actual request is sent
Now that the preflight request is all out of the way (successful or not required), the browser can make the actual request to origin B. The request will include any necessary headers, credentials, or data.
6) Server response to the actual request
Once the server (origin B) receives the request, it then processes it and sends a response. Along with the response, the server will still send the appropriate CORS-related headers.
7) Browser enforcement
Last but not least, the browser will check the CORS headers in the response a final time. If everything checks out then the browser provides the response to the web page’s JavaScript. If not, then the browser will block access to the response and logs a CORS error in the console.
CORS ensures that servers have control over who can access their resources. Browsers enforce these rules to protect users from potential security threats. Whilst CORS does introduce an additional layer of complexity, it provides an effective security measure to ensure safe cross-origin data sharing.
INCREÍBLE 🤯
En la punta del Monte Everest se encontró caliza marina y fósiles de cefalópodos, trilobites, braquiópodos, etc. dando a entender que el punto más alto de la Tierra fue en algún momento parte del fondo marino.
Win a trip to Turkey! 🇹🇷
#Binance is giving away 5 trips (flights, hotel, event entry) to Binance Blockchain Week on Nov 8-9.
Retweet and reply with why you'd like to attend using the hashtag #BinanceBlockchainWeek 👇
HTTPS, SSL Handshake, and Data Encryption Explained to Kids.
HTTPS: Safeguards your data from eavesdroppers and breaches. Understand how encryption and digital certificates create an impregnable shield.
SSL Handshake: Behind the Scenes — Witness the cryptographic protocols that establish a secure connection. Experience the intricate exchange of keys and negotiation.
Secure Data Transmission: Navigating the Tunnel — Journey through the encrypted tunnel forged by HTTPS. Learn how your information travels while shielded from cyber threats.
HTML's Role: Peek into HTML's role in structuring the web. Uncover how hyperlinks and content come together seamlessly. And why is it called HYPER TEXT.
Over to you: In this ever-evolving digital landscape, what emerging technologies do you foresee shaping the future of cybersecurity or the web?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC