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 30
30
to a red error msg. (Report by Ludwig Reiter; fix John Rouillard)
31
31
- issue2550698 - added documentation on filtering using RPN property
32
32
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)
33
36
34
37
Features:
35
38
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ explicitly set.)
68
68
Preventing CSRF Attacks
69
69
-----------------------
70
70
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
72
72
tracker's config.ini should have ``csrf_enforce_header_x-requested-with
73
73
= yes`` or ``required``.
74
74
@@ -77,6 +77,12 @@ that is not hosted at the same origin as Roundup, you must permit
77
77
the origin using the ``allowed_api_origins`` setting in
78
78
``config.ini``.
79
79
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
+
80
86
Rate Limiting API Failed Logins
81
87
-------------------------------
82
88
Original file line number Diff line number Diff line change @@ -719,8 +719,10 @@ def handle_rest(self):
719
719
if not self .is_origin_header_ok (api = True ):
720
720
if 'HTTP_ORIGIN' not in self .env :
721
721
msg = self ._ ("Required Header Missing" )
722
+ err = 'Origin header missing'
722
723
else :
723
724
msg = self ._ ("Client is not allowed to use Rest Interface." )
725
+ err = 'Unauthorized for REST request'
724
726
725
727
# Use code 400. Codes 401 and 403 imply that authentication
726
728
# is needed or authenticated person is not authorized.
@@ -730,6 +732,7 @@ def handle_rest(self):
730
732
self .reject_request (output ,
731
733
message_type = "application/json" ,
732
734
status = 400 )
735
+ logger .error (err )
733
736
return
734
737
735
738
# Handle CORS preflight request. We know rest is enabled
You can’t perform that action at this time.
0 commit comments