Skip to content

Commit f87e0a5

Browse files
committed
stage14-updates
1 parent b761a00 commit f87e0a5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/roadmap/phase-2/stage-14.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Content-Length: 123
2929

3030
The first line contains the HTTP request line. On parsing the following information is retrieved
3131

32-
Method: GET
32+
Method: `GET`
3333

34-
URI/Path: /index.html
34+
URI/Path: `/index.html`
3535

36-
HTTP Version: HTTP/1.1
36+
HTTP Version: `HTTP/1.1`
3737

3838
2. **Header Parsing**
3939

@@ -146,14 +146,14 @@ A struct `xps_http_req_s` is introduced, which stores the information retrieved
146146

147147
- `parser_state`: Holds the current state of the HTTP request parsing process.
148148
- `method_n`: Stores the parsed HTTP method (HTTP_POST, etc.).
149-
- `request_line`: Holds the full request line, such as POST https://www.devdiary.live:3000/api/problems HTTP/1.1.
149+
- `request_line`: Holds the full request line, such as `POST https://www.devdiary.live:3000/api/problems HTTP/1.1`.
150150
- `method`: Stores the HTTP method (e.g., POST).
151-
- `uri`: Holds the full URI (e.g., https://www.devdiary.live:3000/api/problems?key=val).
151+
- `uri`: Holds the full URI (e.g., `https://www.devdiary.live:3000/api/problems?key=val`).
152152
- `schema`: Stores the URI schema (e.g., https).
153-
- `host`: Stores the host part of the URI (e.g., www.devdiary.live).
153+
- `host`: Stores the host part of the URI (e.g., `www.devdiary.live`).
154154
- `port`: Stores the port number extracted from the URI (e.g., 3000).
155-
- `path`: Contains the full path (e.g., /api/problems?key=val).
156-
- `pathname`: Contains just the path without any query parameters (e.g., /api/problems).
155+
- `path`: Contains the full path (e.g., `/api/problems?key=val`).
156+
- `pathname`: Contains just the path without any query parameters (e.g., `/api/problems`).
157157
- `http_version`: Stores the HTTP version (e.g., 1.1). `http_major` and `http_minor` point to the start of the major and minor version numbers in the buffer.
158158
- `headers`: Holds the parsed headers. Each header will be stored as a key-value pair in this vector.
159159
- `header_key_start`, `header_key_end`, `header_val_start`, `header_val_end`: These pointers are used during header parsing to mark the start and end of the key and value of each header.
@@ -960,7 +960,7 @@ printf("REQUEST LINE: %s\n", http_req->request_line);
960960
/*similarly print method,uri,...etc*/
961961
```
962962
963-
Start the server. Open a browser tab and enter a HTTP request for eg: http://localhost:8001/example.com
963+
Start the server. Open a browser tab and enter a HTTP request for eg: `http://localhost:8001/example.com`
964964
965965
Verify the following output is printed in terminal thus ensuring the parsing of request line
966966
@@ -1001,7 +1001,7 @@ strcat(file_path, session->http_req->path);
10011001
10021002
As in the previous file server implementation, the file to be opened should be present in the public folder.
10031003
1004-
We can verify the modification by requesting the file through browser. Start the server and in browser, enter http request message for getting the file. For eg: http://localhost:8001/sample.txt . Here, sample.txt is the file to be opened and it is present in the public folder. Verify that the contents of file are displayed in browser.
1004+
We can verify the modification by requesting the file through browser. Start the server and in browser, enter http request message for getting the file. For eg: `http://localhost:8001/sample.txt` . Here, sample.txt is the file to be opened and it is present in the public folder. Verify that the contents of file are displayed in browser.
10051005
10061006
Now try how the browser responds if the file is not present in public folder.
10071007

0 commit comments

Comments
 (0)