At present it appears that the implementation of ETag in System.Net.Http.Headers imposes some restrictions on usage that are unwarranted under RFC 7232. I know it is done for the best of reasons (I love optimistic concurrency control). I have a big server that runs fine with .NET 2.0 and I would like to use .NET 6 or later instead.
But I am unhappy with the following restrictions:
"The server MUST NOT include an ETag header in a response to any request performed against a URI that does not identify, as specified in URI Format: Resource Addressing Rules (section 2.2.3), a single entity, properties of an entity, or a Media Resource. In addition, the server MUST NOT include an ETag header if the request URI identifies a single entity whose type is not enabled for optimistic concurrency control. Server response requests performed against URIs that do not return single entities MUST provide concurrency tokens in the response payload for any entities that are enabled for concurrency control."
I get error messages from .NET when my server code tries to add the ETag header that it wants to add.
As I understand RFC 7232 all HTTP servers SHOULD include an ETag on all GET requests. The current restrictions are in violation of RFC 7232.
It is also annpoying that the documentation continually refers to RFC 2616 when this RFC is obsoleted by the RFCs 7230-7237. Will this issue be fixed in a future version of .NET?