Skip to content

Commit f3e6434

Browse files
committed
Add error message to PATCH 400 in Server class.
1 parent 71bc42b commit f3e6434

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Server.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Server
1818

1919
public const ERROR_CAN_NOT_PARSE_FOR_PATCH = 'Could not parse the requested resource for patching';
2020
public const ERROR_CAN_NOT_DELETE_NON_EMPTY_CONTAINER = 'Only empty containers can be deleted, "%s" is not empty';
21+
public const ERROR_MISSING_SPARQL_CONTENT_TYPE = 'Request is missing required Content-Type "application/sparql-update" or "application/sparql-update-single-match"';
2122
public const ERROR_NOT_IMPLEMENTED_SPARQL = 'SPARQL Not Implemented';
2223
public const ERROR_PATH_DOES_NOT_EXIST = 'Requested path "%s" does not exist';
2324
public const ERROR_PATH_EXISTS = 'Requested path "%s" already exists';
@@ -182,6 +183,7 @@ private function handle(string $method, string $path, $contents, $request): Resp
182183
$response = $this->handleSparqlUpdate($response, $path, $contents);
183184
break;
184185
default:
186+
$response->getBody()->write(self::ERROR_MISSING_SPARQL_CONTENT_TYPE);
185187
$response = $response->withStatus(400);
186188
break;
187189
}

0 commit comments

Comments
 (0)