Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Real-World Web Development with .NET 9
  • Toc
  • feedback
Real-World Web Development with .NET 9

Real-World Web Development with .NET 9

By : Mark J. Price
3.5 (4)
close
Real-World Web Development with .NET 9

Real-World Web Development with .NET 9

3.5 (4)
By: Mark J. Price

Overview of this book

Real-World Web Development with .NET 9 equips you to build professional websites and services using proven technologies like ASP.NET Core MVC, Web API, and OData—trusted by organizations for delivering robust web applications. You’ll learn to design and build efficient web applications with ASP.NET Core MVC, creating well-structured, maintainable code that follows industry best practices. From there, you'll dive into Web API, mastering how to build RESTful services that are both secure and scalable. Along the way, you’ll also explore testing, authentication, containerization for deployment, ensuring that your solutions are fully production-ready. In the final part of the book, you will be introduced to Umbraco CMS, a popular content management system for .NET. By mastering this tool, you’ll learn how to empower users to manage website content independently. By the end of this book, you'll not only have a solid grasp of controller-based development but also the practical know-how to build dynamic, content-driven websites using a popular .NET CMS.
Table of Contents (16 chapters)
close
Free Chapter
1
Real-World Web Development with .NET 9: Build websites and services using mature and proven ASP.NET Core MVC, Web API, and Umbraco CMS

Relaxing the same origin security policy using CORS

Modern web browsers support multiple tabs so users can visit multiple websites at the same time efficiently. If code executing in one tab could access resources in another tab, then that could be a vector of attack.

All web browsers implement a security feature called the same origin policy. This means that only requests that come from the same origin are allowed. For example, if a block of JavaScript is served from the same origin that hosts a web service or served an <iframe>, then that JavaScript can call the service and access the data in the <iframe>. If a request is made from a different origin, then the request fails. But what counts as the "same origin?"

An origin is defined by:

  • Scheme aka protocol, for example, http or https.
  • Port, for example, 801 or 5081. The default port for http is 80 and for https is 443.
  • Host/domain/subdomain, for example, www.example.com, www.example.net, example.com.

If the origin...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete