aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserAvatarController.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-31 22:49:57 +0800
committerGitHub <noreply@github.com>2020-08-31 22:49:57 +0800
commit3e7e533016b04df4993df66842409cf5857983ee (patch)
tree187696f3303241177820ca65fa441655a03de257 /Timeline/Controllers/UserAvatarController.cs
parentb2404a381178e962a09af018d3c0031f1918991a (diff)
parent7e414fb4a09e6d35fa32d48fdba38a537ffe1d23 (diff)
downloadtimeline-3e7e533016b04df4993df66842409cf5857983ee.tar.gz
timeline-3e7e533016b04df4993df66842409cf5857983ee.tar.bz2
timeline-3e7e533016b04df4993df66842409cf5857983ee.zip
Merge pull request #158 from crupest/dev
Develop new features of back end.
Diffstat (limited to 'Timeline/Controllers/UserAvatarController.cs')
-rw-r--r--Timeline/Controllers/UserAvatarController.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Timeline/Controllers/UserAvatarController.cs b/Timeline/Controllers/UserAvatarController.cs
index 97c4bdb8..bc4afa30 100644
--- a/Timeline/Controllers/UserAvatarController.cs
+++ b/Timeline/Controllers/UserAvatarController.cs
@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
+using Microsoft.Net.Http.Headers;
using System;
using System.Threading.Tasks;
using Timeline.Auth;
@@ -105,7 +106,7 @@ namespace Timeline.Controllers
try
{
- await _service.SetAvatar(id, new Avatar
+ var etag = await _service.SetAvatar(id, new Avatar
{
Data = body.Data,
Type = body.ContentType
@@ -113,6 +114,9 @@ namespace Timeline.Controllers
_logger.LogInformation(Log.Format(LogPutSuccess,
("Username", username), ("Mime Type", Request.ContentType)));
+
+ Response.Headers.Append("ETag", new EntityTagHeaderValue($"\"{etag}\"").ToString());
+
return Ok();
}
catch (ImageException e)