File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3030 to a red error msg. (Report by Ludwig Reiter; fix John Rouillard)
3131- issue2550698 - added documentation on filtering using RPN property
3232 expressions. (John Rouillard)
33+ - issue2551372 - Better document necessary headers for REST and fix
34+ logging to log missing Origin header (Ralf Schlatterbeck with
35+ suggestions on documentation by John Rouillard)
3336
3437Features:
3538
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ explicitly set.)
6868Preventing CSRF Attacks
6969-----------------------
7070
71- Clients should set the header X-REQUESTED-WITH to any value and the
71+ Clients should set the header `` X-REQUESTED-WITH`` to any value and the
7272tracker's config.ini should have ``csrf_enforce_header_x-requested-with
7373= yes`` or ``required``.
7474
@@ -77,6 +77,12 @@ that is not hosted at the same origin as Roundup, you must permit
7777the origin using the ``allowed_api_origins`` setting in
7878``config.ini``.
7979
80+ If you access the REST interface with a method other than ``GET``, you
81+ must also supply an origin header with a value that is either the
82+ default origin (the URL of the tracker without the path component set in
83+ the config file as ``web`` in section ``[tracker]``) or one that is
84+ permitted by ``allowed_api_origins``.
85+
8086Rate Limiting API Failed Logins
8187-------------------------------
8288
Original file line number Diff line number Diff line change @@ -719,8 +719,10 @@ def handle_rest(self):
719719 if not self .is_origin_header_ok (api = True ):
720720 if 'HTTP_ORIGIN' not in self .env :
721721 msg = self ._ ("Required Header Missing" )
722+ err = 'Origin header missing'
722723 else :
723724 msg = self ._ ("Client is not allowed to use Rest Interface." )
725+ err = 'Unauthorized for REST request'
724726
725727 # Use code 400. Codes 401 and 403 imply that authentication
726728 # is needed or authenticated person is not authorized.
@@ -730,6 +732,7 @@ def handle_rest(self):
730732 self .reject_request (output ,
731733 message_type = "application/json" ,
732734 status = 400 )
735+ logger .error (err )
733736 return
734737
735738 # Handle CORS preflight request. We know rest is enabled
You can’t perform that action at this time.
0 commit comments