ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
789 stars 68 forks source link

Bunch of small fixes #337

Closed nemunaire closed 1 week ago

nemunaire commented 1 week ago

I'm cleaning up some patches I made some time ago...

  1. In order to let some email clients/servers to sort properly by date, the email sent by rmfakecloud needs to be dated. This adds a Date header.
  2. Some missing returns after AbortWithStatus.
  3. PUT /sync/v3/files/ doesn't have body on success, nor crc32c:
$ curl -v -s -X PUT -d @file -H "x-goog-hash: crc32c=123456==" -H "Authorization: Bearer $USER_TOKEN" https://internal.cloud.remarkable.com/sync/v3/files/REDACTED
* Connected to internal.cloud.remarkable.com (34.117.147.117) port 443
> PUT /sync/v3/files/REDACTED HTTP/2
> Host: internal.cloud.remarkable.com
> x-goog-hash: crc32c=123456==
> Authorization: Bearer redacted
> Content-Length: 123
>
* upload completely sent off: 123 bytes
< HTTP/2 200
< rm-token-ttl-hint: 9876
< content-length: 0
< date: Sun, 12 Jan 2024 12:34:45 GMT
< server: Google Frontend
< x-cloud-trace-context: redacted;o=1
< traceparent: redacted
< content-type: text/html; charset=UTF-8
< x-envoy-decorator-operation: ingress PutFile
< via: 1.1 google
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
<
* Connection #0 to host internal.cloud.remarkable.com left intact