Bug 53240 - UMC does not work with latest Safari
UMC does not work with latest Safari
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Dirk Wiesenthal
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-10 15:04 CEST by Dirk Wiesenthal
Modified: 2021-05-25 16:01 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2021-05-10 15:04:48 CEST
... at all.

The problem is univention/get/meta which returns 406: "The specified locale is not available".

The header is "Accept-Language: en-us". Note the lower case of the territory.

https://bugs.webkit.org/show_bug.cgi?id=163096
Comment 1 Dirk Wiesenthal univentionstaff 2021-05-10 15:05:22 CEST
Unclear when this is fixed and when Safari gets the update.
Comment 2 Florian Best univentionstaff 2021-05-10 15:16:05 CEST
And this worked on UCS 4.4?
Comment 3 Florian Best univentionstaff 2021-05-10 17:09:23 CEST
I cannot reproduce this:

curl -i http://Administrator:univention@10.200.27.40/univention/get/meta -H "Accept-Language: en-us"
curl -i http://Administrator:univention@10.200.27.40/univention/get/meta -H "Accept-Language: de-at"
Comment 4 Florian Best univentionstaff 2021-05-10 17:09:53 CEST
My fix would be:

diff --git management/univention-management-console/univention-management-console-web-server management/univention-management-console/univention-management-console-web-server
index a81125fa45..ae54404890 100755
--- management/univention-management-console/univention-management-console-web-server
+++ management/univention-management-console/univention-management-console-web-server
@@ -891,6 +891,9 @@ class CPgeneric(Ressource):
                        CORE.warn('malformed Accept-Language header: %s' % (exc,))
                        languages = []
 
+               # fix Safari: https://bugs.webkit.org/show_bug.cgi?id=163096
+               languages = [re.sub('([a-z][a-z]-)([a-z][a-z])', lambda m: m.group(1) + m.group(2).upper(), lang) for lang in languages]
+
                # pre parse the HTTP syntax so that the UMC-Server doesn't need to do this (because there are no utility functions there)
                request.headers['Accept-Language'] = ', '.join(languages) or 'en-US'
Comment 5 Florian Best univentionstaff 2021-05-12 12:28:24 CEST
Adjusting the Acceppt-Language header in the umc-web-server:

univention-management-console (12.0.12-1)
20ec2f481dbd | Bug #53240: workaround UMC access for Safari browsers
Comment 6 Dirk Wiesenthal univentionstaff 2021-05-14 11:19:35 CEST
Okay, works again.

Changelog probably not needed. Did not test 4.4 but it is a Safari bug anyway, most likely introduced in the last couple of weeks.
Comment 7 Florian Best univentionstaff 2021-05-25 16:01:32 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".