Playing Next Lesson In
seconds

Let's Learn AdonisJS 6 #2.4

Validating Route Parameters

In This Lesson

We'll learn how we can return a 404 Not Found exception when someone tries to view a movie that doesn't exist. We'll then learn how we can validate our route parameters using Regular Expressions or matchers.

Created by
@tomgobich
Published

Join the Discussion 3 comments

Create a free account to join in on the discussion
  1. @qu35t

    Warning: When using the fs readFile function, or another readfile function, if you don't check the user input properly, you can expose yourself to the possibility of someone going back into your tree and reading arbitrary files on your server.

    For example :
    * fs.readFileSync('../../../../../../../etc/passwd', 'utf8')
    *
    fs.readFileSync('%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2e%2e%2e%2f%2e%2e%2fetc%2fpasswd', 'utf8')

    3
  2. @mrs3rver

    very good

    1
    1. Responding to mrs3rver
      @tomgobich

      Thank you, mrs3rver!!

      1