mirror of
https://github.com/foss42/apidash.git
synced 2025-05-25 10:16:43 +08:00
feat: ability to override content type
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user