Skip to content

Commit 09cab07

Browse files
don't include the etag header on an entity when using , in line with dataverse (#859)
1 parent 7cebc72 commit 09cab07

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Entity.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ public function get(Transaction $transaction, ?ContextInterface $context = null)
314314

315315
$response = $transaction->getResponse();
316316
$transaction->assertIfMatchHeader($this->getETag());
317-
$transaction->setETagHeader($this->getETag());
317+
if (!$transaction->getExpand()->hasValue()) {
318+
$transaction->setETagHeader($this->getETag());
319+
}
318320

319321
return $response->setResourceCallback($this, function () use ($transaction) {
320322
$this->emitJson($transaction);

tests/Navigation/Navigation.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,12 @@ public function test_create_navigation_property()
251251

252252
public function test_expand_entity()
253253
{
254-
$this->assertJsonResponseSnapshot(
255-
(new Request)
256-
->path($this->airportEntitySetPath.'/1')
257-
->expand('flights')
258-
);
254+
$this
255+
->assertJsonResponseSnapshot(
256+
(new Request)
257+
->path($this->airportEntitySetPath.'/1')
258+
->expand('flights'))
259+
->assertHeaderMissing('etag');
259260
}
260261

261262
public function test_expand_hasone_entity()

0 commit comments

Comments
 (0)