mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 11:08:36 +00:00
Fix /restful/rhizome/insert HTTP status code
Return 403 "Forbidden" instead of 501 "Not implemented" when given a journal bundle
This commit is contained in:
parent
d44d18280a
commit
4b234fbfbd
@ -549,7 +549,7 @@ static int insert_mime_part_end(struct http_request *hr)
|
||||
return 500;
|
||||
}
|
||||
if (r->manifest->is_journal)
|
||||
return http_request_rhizome_response(r, 501, "Insert not supported for journals", NULL);
|
||||
return http_request_rhizome_response(r, 403, "Insert not supported for journals", NULL);
|
||||
assert(r->manifest != NULL);
|
||||
}
|
||||
else if (r->u.insert.current_part == PART_PAYLOAD) {
|
||||
|
@ -973,7 +973,7 @@ test_RhizomeInsertDuplicateManifest() {
|
||||
assert_rhizome_list
|
||||
}
|
||||
|
||||
doc_RhizomeInsertJournal="HTTP RESTful insert Rhizome bundle does not support journals"
|
||||
doc_RhizomeInsertJournal="HTTP RESTful insert Rhizome bundle does not accept journals"
|
||||
setup_RhizomeInsertJournal() {
|
||||
setup
|
||||
echo 'File one' >file1
|
||||
@ -990,8 +990,8 @@ test_RhizomeInsertJournal() {
|
||||
"http://$addr_localhost:$PORTA/restful/rhizome/insert"
|
||||
tfw_cat http.header http.body
|
||||
assertExitStatus == 0
|
||||
assertStdoutIs 501
|
||||
assertJq http.body 'contains({"http_status_code": 501})'
|
||||
assertStdoutIs 403
|
||||
assertJq http.body 'contains({"http_status_code": 403})'
|
||||
assertJqGrep --ignore-case http.body '.http_status_message' 'not supported.*journal'
|
||||
executeOk_servald rhizome list
|
||||
assert_rhizome_list
|
||||
|
Loading…
x
Reference in New Issue
Block a user