Azurite icon indicating copy to clipboard operation
Azurite copied to clipboard

Missing etag in header for GET Operation

Open yshahin opened this issue 3 years ago • 1 comments

Which service(blob, file, queue, table) does this issue concern?

table

Which version of the Azurite was used?

3.18.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm, DockerHub

What's the Node.js version?

18.4.0

What problem was encountered?

GET Entity with PartitionKey= and RowKey= does not return etag in header

Steps to reproduce the issue?

Create entry in azure table with any partition_key and row_key, then perform an http GET request against the entry created

http://127.0.0.1:10002/devstoreaccount1/aztest(PartitionKey='partition_key',RowKey='row_key')

and check the response headers. etag header is not returned

Have you found a mitigation/solution?

Solution is to modify TableHandler.ts line 686

    const response: Models.TableQueryEntitiesWithPartitionAndRowKeyResponse = {
      statusCode: 200,
      date: tableContext.startTime,
      clientRequestId: options.requestId,
      requestId: context.contextID,
      version: TABLE_API_VERSION
    };

to

    const response: Models.TableQueryEntitiesWithPartitionAndRowKeyResponse = {
      statusCode: 200,
      date: tableContext.startTime,
      clientRequestId: options.requestId,
      requestId: context.contextID,
      eTag: entity.eTag,
      version: TABLE_API_VERSION
    };

yshahin avatar Jul 02 '22 03:07 yshahin

Many thanks for raising this. Someone is working on it.

edwin-huber avatar Jul 12 '22 19:07 edwin-huber