stmcginnis / gofish

Gofish is a Golang client library for DMTF Redfish and SNIA Swordfish interaction.
BSD 3-Clause "New" or "Revised" License
211 stars 112 forks source link

Add option to clean etag before PATCH and POST #275

Closed TyphonHill closed 11 months ago

TyphonHill commented 11 months ago

While using this client with Intel machines, we came across an issue where PATCH and POST requests were failing due to unmatched etags. Some vendors surround header etag with quotes, which need to be cleaned before sending a patch.

This MR simply adds an option to trim quotes from the etag before it is added to the header of the request

stmcginnis commented 11 months ago

Any idea if it's safe to just always do this?

TyphonHill commented 11 months ago

Don't think it's safe to always have it enabled. This issue only applies to some vendors. In our case we came across it when dealing with some Intel machines. That's why I added a flag. A second option is to simply not add the etag to the header using "If-Match", but that would essentially remove support for etags