Closed DavZim closed 2 years ago
This also closes the side-discussion of #181 around ETags
@DavZim Thanks for PR. It will take some time to review. I will try this week. In the meantime I will submit v 1.0.0 to CRAN aa they asked to fix failing tests before 2022-03-30. We can include this PR to the next 1.1.0 version.
@dselivanov I know you are busy and I highly appreciate your free maintenance of open source projects. Do you have a rough time horizon for this PR? Also, is there anything I can take off your shoulders here to speed up the process??
@artemklevtsov any comments?
Looks good for me.
Merging #182 (550d788) into dev (96513b9) will decrease coverage by
0.20%
. The diff coverage is90.62%
.:exclamation: Current head 550d788 differs from pull request most recent head 8db7150. Consider uploading reports for the commit 8db7150 to get more accurate results
@@ Coverage Diff @@
## dev #182 +/- ##
==========================================
- Coverage 95.07% 94.86% -0.21%
==========================================
Files 27 28 +1
Lines 1300 1364 +64
==========================================
+ Hits 1236 1294 +58
- Misses 64 70 +6
Impacted Files | Coverage Δ | |
---|---|---|
R/Application.R | 96.71% <ø> (ø) |
|
R/AuthBackend.R | 100.00% <ø> (ø) |
|
R/ETagMiddleware.R | 89.83% <89.83%> (ø) |
|
R/ContentHandlersFactory.R | 97.05% <100.00%> (+1.47%) |
:arrow_up: |
R/EncodeDecodeMiddleware.R | 100.00% <100.00%> (ø) |
|
src/format_cookies.cpp | 96.15% <0.00%> (-3.85%) |
:arrow_down: |
src/parse_multipart.cpp | 99.00% <0.00%> (+0.01%) |
:arrow_up: |
src/utils.cpp | 55.55% <0.00%> (+1.01%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 96513b9...8db7150. Read the comment docs.
@DavZim RestRserve 1.1.0 is on CRAN - https://cran.r-project.org/web/packages/RestRserve/
This PR adds Middleware for ETags to RestRServe.
ETags are supported for static files but also for other returned objects. Note, that this PR adds
digest
as a dependency, which can be included as a Suggests if needed.Headers currently implemented are:
ETag
andLast-Modified
If-None-Match
andIf-Modified-Since
(Not (yet) implemented areIf-Match
andIF-Unmodified-Since
.Similar implementations can be found for Go fiber or fastapi.
A simple example of usage is found in the code example: