aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http/Common.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-19 22:52:01 +0800
committer杨宇千 <crupest@outlook.com>2019-08-19 22:52:01 +0800
commit87513987a23ecd75cd21015ed215bae3b279d8c5 (patch)
tree5725e61da570be86173472d68bd6df521e593b65 /Timeline/Models/Http/Common.cs
parent72ab8e49929d528b7cb461ba90ad86691a3f437b (diff)
downloadtimeline-87513987a23ecd75cd21015ed215bae3b279d8c5.tar.gz
timeline-87513987a23ecd75cd21015ed215bae3b279d8c5.tar.bz2
timeline-87513987a23ecd75cd21015ed215bae3b279d8c5.zip
Add check for content in avatar put.
Diffstat (limited to 'Timeline/Models/Http/Common.cs')
-rw-r--r--Timeline/Models/Http/Common.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Timeline/Models/Http/Common.cs b/Timeline/Models/Http/Common.cs
index b4932754..50f6836e 100644
--- a/Timeline/Models/Http/Common.cs
+++ b/Timeline/Models/Http/Common.cs
@@ -9,6 +9,10 @@ namespace Timeline.Models.Http
/// For example a required field is null.
/// </summary>
public const int InvalidModel = -100;
+
+ public const int Header_Missing_ContentType = -111;
+ public const int Header_Missing_ContentLength = -112;
+ public const int Header_Zero_ContentLength = -113;
}
public static CommonResponse InvalidModel(string message)
@@ -16,6 +20,21 @@ namespace Timeline.Models.Http
return new CommonResponse(ErrorCodes.InvalidModel, message);
}
+ public static CommonResponse MissingContentType()
+ {
+ return new CommonResponse(ErrorCodes.Header_Missing_ContentType, "Header Content-Type is required.");
+ }
+
+ public static CommonResponse MissingContentLength()
+ {
+ return new CommonResponse(ErrorCodes.Header_Missing_ContentLength, "Header Content-Length is missing or of bad format.");
+ }
+
+ public static CommonResponse ZeroContentLength()
+ {
+ return new CommonResponse(ErrorCodes.Header_Zero_ContentLength, "Header Content-Length must not be 0.");
+ }
+
public CommonResponse()
{