Skip to content

Commit

Permalink
Oai.php: send response header immidiately so a client knows we are ha…
Browse files Browse the repository at this point in the history
…ndling the request
  • Loading branch information
zozlak committed Sep 2, 2021
1 parent 2d50f6b commit 0b1c912
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/acdhOeaw/arche/oaipmh/Oai.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ public function handleRequest(): void {
$params[] = preg_replace('/[^a-zA-Z]/', '', $key) . '="' . htmlentities($value) . '"';
}
printf(self::$respBegin, gmdate('Y-m-d\TH:i:s\Z'), implode(' ', $params), htmlentities($this->info->baseURL));
// try to send some output so the client knows something's going on
ob_flush();
flush();

try {
$verb = $this->getParam('verb') . '';
Expand Down
4 changes: 2 additions & 2 deletions src/acdhOeaw/arche/oaipmh/metadata/LiveCmdiMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ private function insertCmdiComponents(DOMElement $el, Resource $meta,
foreach ($meta->all($prop) as $i) {
if ($i instanceof Literal) {
// use a copy of the metadata with only a single value of the filtered property
$resTmp = new RepoResourceDb($meta->getUri(), $this->res->getRepo());
$metaTmp = $meta->copy();
$resTmp = new RepoResourceDb($meta->getUri(), $this->res->getRepo());
$metaTmp = $meta->copy();
$metaTmp->delete($prop);
$metaTmp->addLiteral($prop, $i);
$resTmp->setGraph($metaTmp);
Expand Down

0 comments on commit 0b1c912

Please sign in to comment.