Closed AntonioSpalluto closed 8 years ago
Hi, yes, it must be there. Which version of RESTHeart and MongoDB are you running?
Hi Maurizio,
RestHeart 1.0.3 MongoDB 3.0.7
Thanks
On 23 December 2015 at 19:30, Maurizio Turatti notifications@github.com wrote:
Hi, yes, it must be there. Which version of RESTHeart and MongoDB are you running?
— Reply to this email directly or view it on GitHub https://github.com/SoftInstigate/restheart/issues/82#issuecomment-166964716 .
If the document was not created by RESTHeart then the ETAG is not there. You can try PATCHing the document using either curl or httpie without changing anything and RESTHeart should create the missing ETAG
Is there any way to enable the auto creation of the etag on mongodb resources? I cannot see any valid reasons to not enable it.
Antonio Spalluto Chief Technology Officer
Authentic Gaming
The _etag is auto created by restheart.
This happens on any write operation (PUT, POST and PATCH)
Of course if data has not been created by restheart, you wont find it there unless your client adds { "_etag": new ObjectId() } to the insert.
To fix it you can PATCH your documents and restheart will add it for you.
If you have many documents you can easily add the _etag from the mongo shell with a batch update.
Adding the _etag property on GET requests as well would violate the http protocol that mandates GET to be always a safe method (doesn't change the status of the resource).
Hi Andrea,
This sounds like the solution for me.
Hi All,
I have a problem with the return of the ETag response header parameter. I just upgraded the version to the 2.0.1 but now I am not getting any etag like it was supposed to be. You can test it from this url: http://ag-messagebroker.westeurope.cloudapp.azure.com:8080/info/statistics/agcasino-virtualroulette1/25
Thanks
I reopen this
Hi Andrea,
This is quite strange, usually the ETag parameter is always returned into the response header in order to cache it at browser level. In this way it is useless for caching purposes.
What do you think about it?
Thanks
Hi @AntonioSpalluto
you are right, bug confirmed. will fix asap
Thanks.
Looking forward for the new release!
hi, this is fixed now in 2.0.x branch
will release 2.0.2 next week
thanks for reporting
@AntonioSpalluto @ujibang Release 2.0.2 is available now. https://github.com/SoftInstigate/restheart/releases/tag/2.0.2
Thanks a lot for the quick fix
Hi All,
I would like to turn on the ETAG into the server response. As you can see in the following link it is not there, but the doc states it should be always there. http://ag-messagebroker.westeurope.cloudapp.azure.com:8080/info/statistics/ag-virtualroulette-1/10?v0.0.1
Is this something missing into the configuration?
Many Thanks