Skip to content

Commit 325978a

Browse files
authored
Merge pull request #216 from PCoder23/headers_list
Enhancement: Added more HTTP headers suggestions
2 parents 9936217 + 51be09b commit 325978a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/utils/header_utils.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Map<String, String> headers = {
22
"Accept": "Specifies the media types that are acceptable for the response.",
33
"Accept-Encoding":
44
"Indicates the encoding methods the client can understand.",
5+
"Accept-Charset": "Specifies the character sets that are acceptable.",
56
"Access-Control-Allow-Headers":
67
"Specifies a list of HTTP headers that can be used in an actual request after a preflight request including the Access-Control-Request-Headers header is made.",
78
"Access-Control-Allow-Methods":
@@ -41,11 +42,16 @@ Map<String, String> headers = {
4142
"Cross-Origin-Resource-Policy":
4243
"Controls how cross-origin requests for resources are handled.",
4344
"Date": "Indicates the date and time at which the message was sent.",
45+
"Device-Memory":
46+
"Indicates the approximate amount of device memory in gigabytes.",
4447
"DNT":
4548
"Informs websites whether the user's preference is to opt out of online tracking.",
4649
"Expect": "Indicates certain expectations that need to be met by the server.",
4750
"Expires":
4851
"Contains the date/time after which the response is considered expired",
52+
"Forwarded":
53+
"Contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request.",
54+
"From": "Contains an Internet email address for a human user who controls the requesting user agent.",
4955
"Host": "Specifies the domain name of the server and the port number.",
5056
"If-Match":
5157
"Used for conditional requests, allows the server to respond based on certain conditions.",
@@ -57,9 +63,15 @@ Map<String, String> headers = {
5763
"Used in conjunction with the Range header to conditionally request a partial resource.",
5864
"If-Unmodified-Since":
5965
"Used for conditional requests, allows the server to respond based on certain conditions.",
66+
"Keep-Alive":
67+
"Used to allow the connection to be reused for further requests.",
6068
"Location":
6169
"Indicates the URL a client should redirect to for further interaction.",
70+
"Max-Forwards":
71+
"Indicates the remaining number of times a request can be forwarded by proxies.",
6272
"Origin": "Specifies the origin of a cross-origin request.",
73+
"Proxy-Authorization":
74+
"Contains credentials for authenticating a client with a proxy server.",
6375
"Range":
6476
"Used to request only part of a resource, typically in the context of downloading large files.",
6577
"Referer":
@@ -68,10 +80,14 @@ Map<String, String> headers = {
6880
"Specifies how much information the browser should include in the Referer header when navigating to other pages.",
6981
"Retry-After":
7082
"Informs the client how long it should wait before making another request after a server has responded with a rate-limiting status code.",
83+
"Save-Data":
84+
"Indicates the client's preference for reduced data usage.",
7185
"Server": "Indicates the software used by the origin server.",
7286
"Strict-Transport-Security":
7387
"Instructs the browser to always use HTTPS for the given domain.",
7488
"TE": "Specifies the transfer encodings that are acceptable to the client.",
89+
"Upgrade-Insecure-Requests":
90+
"Instructs the browser to prefer secure connections when available.",
7591
"User-Agent":
7692
"Identifies the client software and version making the request.",
7793
"Via":

test/utils/header_utils_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void main() {
115115
String pattern = "x-";
116116
List<String> expected = [
117117
"Access-Control-Max-Age",
118+
"Max-Forwards",
118119
"X-Api-Key",
119120
"X-Content-Type-Options",
120121
"X-CSRF-Token",

0 commit comments

Comments
 (0)