Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core

Commits:
f78e7a4f by Abhilash Raj at 2018-05-16T16:16:50Z
REST: Set REALM properly in Mailman' API server.

Fixes #366

- - - - -
b81df81d by Abhilash Raj at 2018-05-16T21:51:28Z
Merge branch 'issue-366' into 'master'

REST: Set REALM properly in Mailman's API server.

Closes #366

See merge request mailman/mailman!392
- - - - -


1 changed file:

- src/mailman/rest/wsgiapp.py


Changes:

=====================================
src/mailman/rest/wsgiapp.py
=====================================
--- a/src/mailman/rest/wsgiapp.py
+++ b/src/mailman/rest/wsgiapp.py
@@ -37,6 +37,7 @@ MISSING = object()
 SLASH = '/'
 EMPTYSTRING = ''
 REALM = 'mailman3-rest'
+UTF8 = 'utf-8'
 
 
 class AdminWSGIServer(WSGIServer):
@@ -96,10 +97,11 @@ class Middleware:
                 authorized = True
         if not authorized:
             # Not authorized.
+            realm = 'Basic realm="{}",charset="{}"'.format(REALM, UTF8)
             raise HTTPUnauthorized(
                 '401 Unauthorized',
                 'REST API authorization failed',
-                challenges=['Basic realm=Mailman3'])
+                challenges=[realm])
 
 
 class ObjectRouter:



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/e99db07cffdf19f48821d3d317460c4c3675e07e...b81df81d0c1c759ae2fbfc530c69be535aa41713

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/e99db07cffdf19f48821d3d317460c4c3675e07e...b81df81d0c1c759ae2fbfc530c69be535aa41713
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to