Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

Missing etag in header for GET Operation #1579

Open yshahin opened 2 years ago

yshahin commented 2 years ago

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
    };
edwin-huber commented 2 years ago

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