Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Request Parser The process of initiating an action on a server is done through HITP requests which are messages sent by the client. The two

Request Parser
The process of initiating an action on a server is done through HITP requests which are messages sent by the client. The two most commonity used HITP requests are GET and POST, This task involves validating requests and parsing URL parameters as a comma-separated string. Authentication tokens for both GET and POST requests are sent as a URL parameter named "token". For validation of authentication, the tokens must be in a set of valid authentication tokens. In the case of a POST request, a CSRF (cross-site request forgery) token must also be provided. A POST request is considered valid if its authentication token is valid and its CSRF token is an alphanumeric value consisting only of lowercase letters and/or numbers with a minimum length of 8. Once a request is validated, the URL parameters must be parsed as a comma-separated string.
5
6
URL parameters are identified by the portion of the URL that comes after a question mark (?). They consist of a key and a value, separated by an equat sign (=). Multiple parameters are separated by an ampersand (&).
7
Implementation a request parser prototype. Given
8 an array of strings, valid auth tokens, representing the valid authentication tokens, and a 20 array of strings, requests, representing the request types
9
and URLS, for each request, return the request
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions