Skip to content

Commit f7938ae

Browse files
authored
Merge pull request #5796 from apache/auto-purge-ctype
validate content-type for PUT /db/_auto_purge
2 parents ebe62f8 + ac3873f commit f7938ae

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/chttpd/src/chttpd_db.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ handle_auto_purge_req(#httpd{method = 'GET'} = Req, Db) ->
398398
chttpd:send_error(Req, Reason)
399399
end;
400400
handle_auto_purge_req(#httpd{method = 'PUT'} = Req, Db) ->
401+
chttpd:validate_ctype(Req, "application/json"),
401402
{AutoPurgeProps} = chttpd:json_body_obj(Req),
402403
validate_auto_purge_props(AutoPurgeProps),
403404
case fabric:set_auto_purge_props(Db, AutoPurgeProps) of

0 commit comments

Comments
 (0)