aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-11-17 07:43:57 +0100
committerivarlovlie <git@ivarlovlie.no>2022-11-17 07:43:57 +0100
commitdcc17d96a6701f7a8ee2186bf7c5b3f89a154359 (patch)
treee97cbae985c69b3d2d93110fc5f41f8855e49129 /code
parentcf19e06b320be1cfc390a6fbf917c243c6b4dd40 (diff)
downloadgreatoffice-dcc17d96a6701f7a8ee2186bf7c5b3f89a154359.tar.xz
greatoffice-dcc17d96a6701f7a8ee2186bf7c5b3f89a154359.zip
feat: Inform about KnowProblem in response headers
Diffstat (limited to 'code')
-rw-r--r--code/api/src/Data/Static/AppHeaders.cs2
-rw-r--r--code/api/src/Endpoints/EndpointBase.cs4
2 files changed, 4 insertions, 2 deletions
diff --git a/code/api/src/Data/Static/AppHeaders.cs b/code/api/src/Data/Static/AppHeaders.cs
index 7912418..d534aba 100644
--- a/code/api/src/Data/Static/AppHeaders.cs
+++ b/code/api/src/Data/Static/AppHeaders.cs
@@ -3,5 +3,5 @@ namespace IOL.GreatOffice.Api.Data.Static;
public static class AppHeaders
{
public const string BROWSER_TIME_ZONE = "X-TimeZone";
- public const string VAULT_TOKEN = "X-Vault-Token";
+ public const string IS_KNOWN_PROBLEM = "X-IsKnownProblem";
}
diff --git a/code/api/src/Endpoints/EndpointBase.cs b/code/api/src/Endpoints/EndpointBase.cs
index 6850755..8b9bbf0 100644
--- a/code/api/src/Endpoints/EndpointBase.cs
+++ b/code/api/src/Endpoints/EndpointBase.cs
@@ -14,7 +14,8 @@ public class EndpointBase : ControllerBase
};
[NonAction]
- protected ActionResult KnownProblem(string title = default, string subtitle = default, Dictionary<string, string> errors = default) {
+ protected ActionResult KnownProblem(string title = default, string subtitle = default, Dictionary<string, string[]> errors = default) {
+ HttpContext.Response.Headers.Add(AppHeaders.IS_KNOWN_PROBLEM, "1");
return BadRequest(new KnownProblemModel {
Title = title,
Subtitle = subtitle,
@@ -25,6 +26,7 @@ public class EndpointBase : ControllerBase
[NonAction]
protected ActionResult KnownProblem(KnownProblemModel problem) {
+ HttpContext.Response.Headers.Add(AppHeaders.IS_KNOWN_PROBLEM, "1");
return BadRequest(problem);
}