Pull to refresh
371.07

Website development *

Making the Web Better

Show first
Rating limit
Level of difficulty

Scanning the code of Orchard CMS for Bugs

Reading time12 min
Views988

Picture 6

This article reviews the results of a second check of the Orchard project with the PVS-Studio static analyzer. Orchard is an open-source content manager system delivered as part of the ASP.NET Open Source Gallery under the non-profit Outercurve Foundation. Today's check is especially interesting because both the project and the analyzer have come a long way since the first check, and this time we'll be looking at new diagnostic messages and some nice bugs.
Read more →
Total votes 34: ↑33 and ↓1+32
Comments0

Don't forget about Open Graph

Reading time2 min
Views6K
Open Graph protocol is a web standard originally developed by Facebook that turns any webpage into a graph object with title, description, image and so on. Even though there is no direct correlation between OG meta tags and improved SEO rankings, it still drives more traffic to your webpage by making it more “attractive” in social networks (Facebook, Twitter, Linkedin, etc).

An example of a link shared in Twitter that has «og:image» and «og:title».

image

Adding OG (and not only) meta tags into your React app


Without further due let’s jump into newly created React app with create-react-app and OG meta tags to /public/index.html. It should look like something like this:

<!DOCTYPE html>
<html>
   <head>
      <meta charSet="utf-8"/>
      <meta http-equiv="x-ua-compatible" content="ie=edge"/>
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
      <link rel="alternate" type="application/rss+xml" href="/rss.xml"/>
      <title>Awesome App</title>
      <meta property="og:title" content="Awesome app - the best app ever" />
      <meta property="og:type" content="website" />
      <meta property="og:image" content="https://picsum.photos/id/52/1200/600" />
      <meta property="og:description" content="Describe stuff here." />
      <meta property="og:url" content="yourawesomeapp.com" />
   </head>
   <body>
      <noscript>This app works best with JavaScript enabled.</noscript>
      <div id="root"></div>
   </body>
</html>

Read more →
Total votes 23: ↑21 and ↓2+19
Comments3

Vue.js Is Good, But Is It Better Than Angular or React?

Reading time3 min
Views6.1K
Vue.js is a JavaScript library for building web interfaces. Combining with some other tools It also becomes a “framework”. Now, from our last blog, you already know that Vue.js is one of the top JavaScript frameworks and it is replacing Angular and React in many cases. This brings in the topic of this blog ‘Vue.js is good, but is it better than Angular or React?


In case you’ve never heard or used Vue.js before, you are probably thinking: Come on! yet another JavaScript framework! We get it. However, Vue.js is not new in the custom software development domain. It was first released in 2013 and now it has 130549 stars on Github and downloaded a number of times this year.
Total votes 22: ↑19 and ↓3+16
Comments6

Learn Bootstrap Fast With These 10 Helpful Tips

Reading time5 min
Views2.6K
If you want to start your career in web development then learning Bootstrap is the way to go. Bootstrap is basically a framework used for front-end development of web apps. Its front-end component library is widely used to create interactive and responsive web apps and websites that we are used to today.

If you don’t already know, you must be wondering what responsive websites are? In simple terms, the responsiveness of a website means that when the size of the screen on which the website is being seen changes, the layout of the website responds to that and change. This makes the websites look good no matter what screen size it is being viewed on.

How does Bootstrap work?


There are two ways you can use Bootstrap. You can either import the Bootstrap into your code or you can download a sample Bootstrap project and build your website on that.

Bootstrap uses a 12-column model for website display, which is called a Bootstrap grid. On this grid, you can define different breakpoints to layout different components like headings, paragraphs, and buttons to make your website look visually appealing. When the screen size scales down, the components on the grid change layout to fit the smaller screen. This means that viewing the same website looks great on a normal size screen of your laptop and a smaller screen of your smartphone.

Bootstrap has become one of the most popular front-end development frameworks today. If you are a beginner who wants to start learning Bootstrap then you are on the right blog. Because here are the top 10 tips to learn and master Bootstrap!
Read more →
Total votes 18: ↑16 and ↓2+14
Comments0

Really typing Vue

Reading time6 min
Views7.5K

Logo


inb4: This is not another "setting up" a new project with Vue and TypeScript tutorial. Let's do some deep dive into more complex topics!


typescript is awesome. Vue is awesome. No doubt, that a lot of people try to bundle them together. But, due to different reasons, it is hard to really type your Vue app. Let's find out what are the problems and what can be done to solve them (or at least minimize the impact).

Read more →
Total votes 11: ↑11 and ↓0+11
Comments1

Protocol for communication between iframe and the main window

Reading time4 min
Views4.9K

From time to time, developers need to establish communication between several browser tabs to be able to send messages from one tab to another and receive responses. We have also faced this need at some point.


Some solutions already exist (like, for instance, BroadcastChannel API). However, its browser support leaves a lot to be desired, so we decided to use our own library. When the library was ready, that functionality was no longer required. Nevertheless, another task emerged: communication between an iframe and the main window.


On closer examination, it turned out that two-thirds of the library would not have to be changed — only some code refactoring was necessary. The library is a communication PROTOCOL that can work with text data. It can be applied in all cases in which text is transferred, such as iframes, window.open, worker, browser tabs or WebSocket.


How it works


Currently, the protocol has two functions: sending messages and subscription to events. Any message in the protocol is a data object. For us, the main field in that object is type, which tells us what kind of message it is. The type field is an enum with the following values:

Read more →
Total votes 13: ↑12 and ↓1+11
Comments2

Let's help QueryProvider deal with interpolated strings

Reading time5 min
Views1.6K

Specifics of QueryProvider


QueryProvider can’t deal with this:


var result = _context.Humans
                      .Select(x => $"Name: {x.Name}  Age: {x.Age}")
                      .Where(x => x != "")
                      .ToList();

It can’t deal with any sentence using an interpolated string, but it’ll easily deal with this:


var result = _context.Humans
                      .Select(x => "Name " +  x.Name + " Age " + x.Age)
                      .Where(x => x != "")
                      .ToList();

The most painful thing is to fix bugs after turning on ClientEvaluation (exception for client-side calculation), since all Automapper profiles should be strictly analyzed for interpolation. Let’s find out what’s what and propose our solution to the problem.

Read more →
Total votes 12: ↑11 and ↓1+10
Comments0

The most common OAuth 2.0 Hacks

Reading time6 min
Views41K

OAuth 2 overview


This article assumes that readers are familiar with OAuth 2. However, below a brief description of it is presented below.



  1. The application requests authorization to access service resources from the user. The application needs to provide the client ID, client secret, redirect URI and the required scopes.
  2. If the user authorizes the request, the application receives an authorization grant
  3. The application requests an access token from the authorization server by presenting authentication of its own identity, and the authorization grant
  4. If the application identity is authenticated and the authorization grant is valid, the authorization server issues the access and refresh (if required) token to the application. Authorization is complete.
  5. The application requests the resource from the resource server and presents the access token for authentication
  6. If the access token is valid, the resource server serves the resource to the application

The are some main Pros and Cons in OAuth 2.0


  • OAuth 2.0 is easier to use and implement (compared to OAuth 1.0)
  • Wide spread and continuing growing
  • Short lived Tokens
  • Encapsulated Tokens

— No signature (relies solely on SSL/TLS ), Bearer Tokens
— No built-in security
— Can be dangerous if used from not experienced people
— Too many compromises. Working group did not make clear decisions
— Mobile integration (web views)
— Oauth 2.0 spec is not a protocol, it is rather a framework — RFC 6749

Read more →
Total votes 18: ↑17 and ↓1+16
Comments2

Web and Azure Tool Updates in Visual Studio 2019

Reading time2 min
Views875

Hopefully by now you’ve seen that Visual Studio 2019 is now generally available. As you would expect, we’ve added improvements for web and Azure development. As a starting point, Visual Studio 2019 comes with a new experience for getting started with your code and we updated the experience for creating ASP.NET and ASP.NET Core projects to match:



If you are publishing your application to Azure, you can now configure Azure App Service to use Azure Storage and Azure SQL Database instances, right from the publish profile summary page, without leaving Visual Studio. This means that for any existing web application running in App Service, you can add SQL and Storage, it is no longer limited to creation time only.

Read more →
Total votes 11: ↑11 and ↓0+11
Comments0

Web application firewalls

Reading time6 min
Views3.9K

Web application firewall


Web application firewalls (WAFs) are a type of intrusion detection and prevention system and might be either a hardware or software solution. It is specifically designed to inspect HTTP(s) and analyse the GET and POST requests using the appalling detection logic explained below. Web application firewall software is generally available as a web server plugin.

WAF has become extremely popular and various companies offer a variety of solutions in different price categories, from small businesses to large corporations. Modern WAF is popular because it has a wide range of covered tasks, so web application developers can rely on it for various security issues, but with the assumption that this solution cannot guarantee absolute protection. A basic WAF workflow is shown below.



Its main function is the detection and blocking of queries in which, according to WAF analysis, there are some anomalies, or an attacking vector is traced. Such an analysis should not make it difficult for legitimate users to interact with a web application, but, at the same time, it must accurately and timely detect any attempted attack. In order to implement this functionality, WAF developers usually use regular expressions, tokens, behavioural analysis, reputation analysis and machine learning, and, often, all these technologies are used together.



In addition, WAF can also provide other functionality: protection from DDoS, blocking of IP-addresses of attackers, tracking of suspicious IP-addresses, adding an HTTP-only flag to the cookie, or adding the functionality of CSRF-tokens. Each WAF is individual and has a unique internal arrangement, but there are some typical methods used for analysis.
Read more →
Total votes 15: ↑13 and ↓2+11
Comments0
1
Change theme settings

Authors' contribution