diff options
| author | crupest <crupest@outlook.com> | 2020-08-31 22:49:57 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 22:49:57 +0800 |
| commit | edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329 (patch) | |
| tree | fdd69c951f68cda72ac1cbf017ca272ee1b783f5 /Timeline/Filters | |
| parent | 1886b3411c69d8eb4fffbbfe29eb3a917d04e2f4 (diff) | |
| parent | ff90e2819a1c0b7d1b605b45edaaaee7527c05b1 (diff) | |
| download | timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.tar.gz timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.tar.bz2 timeline-edfefcf9bdbf5ba186a8f2c7d021acf04dbbb329.zip | |
Merge pull request #158 from crupest/dev
Develop new features of back end.
Diffstat (limited to 'Timeline/Filters')
| -rw-r--r-- | Timeline/Filters/Timeline.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Timeline/Filters/Timeline.cs b/Timeline/Filters/Timeline.cs index 90b87223..6a730ee7 100644 --- a/Timeline/Filters/Timeline.cs +++ b/Timeline/Filters/Timeline.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Timeline.Models.Http;
using Timeline.Services.Exceptions;
@@ -13,11 +14,17 @@ namespace Timeline.Filters {
if (e.InnerException is UserNotExistException)
{
- context.Result = new NotFoundObjectResult(ErrorResponse.UserCommon.NotExist());
+ if (HttpMethods.IsGet(context.HttpContext.Request.Method))
+ context.Result = new NotFoundObjectResult(ErrorResponse.UserCommon.NotExist());
+ else
+ context.Result = new BadRequestObjectResult(ErrorResponse.UserCommon.NotExist());
}
else
{
- context.Result = new NotFoundObjectResult(ErrorResponse.TimelineController.NotExist());
+ if (HttpMethods.IsGet(context.HttpContext.Request.Method))
+ context.Result = new NotFoundObjectResult(ErrorResponse.TimelineController.NotExist());
+ else
+ context.Result = new BadRequestObjectResult(ErrorResponse.TimelineController.NotExist());
}
}
}
|
