feat: ability to override content type

This commit is contained in:
APPALA REDDI
2023-12-30 12:35:10 +05:30
parent 3423eb7d8f
commit e0fe907d19
4 changed files with 36 additions and 1 deletions

View File

@ -15,6 +15,7 @@ Map<String, String> headers = {
"Indicates the encoding transformations that have been applied to the entity body of the response.",
"Content-Security-Policy":
"Controls the sources from which content can be loaded on a web page to mitigate various types of attacks.",
"Content-Type": "Indicates the original media type of the resource (prior to any content encoding applied for sending)",
"Cookie": "Used to send previously stored cookies back to the server.",
"Cross-Origin-Embedder-Policy":
"Controls whether a document is allowed to be embedded in another document.",
@ -70,3 +71,13 @@ List<String> getHeaderSuggestions(String pattern) {
)
.toList();
}
List<String> headerValues = ['application/json', 'text/plain'];
List<String> getHeaderValueSuggestions(String pattern) {
return headerValues
.where(
(element) => element.contains(pattern.toLowerCase()),
)
.toList();
}