Fix duplicated etag generation
bmcweb generates the duplicated etags on GET and it may cause the
PATCH failure if etag is used - e.g. redfishtool..
This commit is to put only one Etag on http_response on GET.
Tested:
- Check the duplicated Etag on GET, and check it after fix
Before:
```
$ curl -v -k -X GET https://admin:${password}@${bmc}:18080/redfish/v1/AccountService/Accounts/readonly
...
< ETag: "D4B30BB4"
< ETag: "D4B30BB4"
```
After:
```
$ curl -v -k -X GET https://admin:${password}@${bmc}:18080/redfish/v1/AccountService/Accounts/readonly
...
< ETag: "D4B30BB4"
```
Change-Id: I5361919c5671b546181a26de792bc57de2c4f670
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/http/http_response.hpp b/http/http_response.hpp
index 123a7e1..dca7682 100644
--- a/http/http_response.hpp
+++ b/http/http_response.hpp
@@ -219,11 +219,6 @@
void end()
{
- std::string etag = computeEtag();
- if (!etag.empty())
- {
- addHeader(http::field::etag, etag);
- }
if (completed)
{
BMCWEB_LOG_ERROR("{} Response was ended twice", logPtr(this));