diff doc/upgrading.txt @ 8543:1ffa1f42e1da

refactor: rework mime type comparison and clean code rest.py: accept application/* as match for application/json in non /binary_context rest path. allow defining default mime type to return when file/message is missing mime type. Make it a class variable to it can be changed from text/plain to text/markdown or whatever. extract code from determine_output_format() to create create_valid_content_types() method which returns a list of matching mime types for a given type/subtype. Eliminate mostly duplicate return statements by introducing a variable to specify valid mime types in error message. rest_common.py: Fix error messages that now return application/* as valid mime type. CHANGES.txt upgrading.txt rest.txt: top level notes and corrections. Also correct rst syntax on earlier change.
author John Rouillard <rouilj@ieee.org>
date Tue, 24 Mar 2026 21:30:47 -0400
parents 4184173d364f
children e738377b4ffe
line wrap: on
line diff
--- a/doc/upgrading.txt	Tue Mar 24 16:56:38 2026 -0400
+++ b/doc/upgrading.txt	Tue Mar 24 21:30:47 2026 -0400
@@ -255,7 +255,7 @@
 newer.
 
 To add this to your tracker, change the ``page.html`` (for TAL
-based trackers) or ``layout/navigation.html (for jinja2 trackers).
+based trackers) or ``layout/navigation.html`` (for jinja2 trackers).
 
 For TAL trackers, replace the ``required`` parameter by finding
 the following password input in the tracker's ``html/page.html``
@@ -279,6 +279,29 @@
 
   <input class="form-control form-control-sm" spellcheck="false" type="password" name="__login_password" placeholder='password' {{ "required" if not db.config.WEB_LOGIN_EMPTY_PASSWORDS }}>
 
+REST interface changes (info)
+-----------------------------
+
+The default type of a message file (the msg class) is now
+``text/plain``.  This can be change to a different mime type using
+`the interfaces.py file`_. See `the rest documentation on getting file
+content for details <rest.html#getting-message-and-files-content>`_.
+
+Roundup supports a wildcard mime type. So ``text/*`` would match any
+text resource. The response to this request should have a full mime
+type like ``text/plain`` or ``text/csv`` etc. However Roundup used to
+return ``text/*`` which makes it difficult for the client to interpret
+the data. This release should do a better job of returning a proper
+subtype replacing the ``*``.
+
+The mime type of ``application/*`` resolves to ``application/json`` by
+default. Using it before resulted in an error.
+
+Malformed mime types assigned to files/messages could cause a crash,
+now they are just ignored.
+
+There have been some internal refactorings and improvements in the
+REST code that will make it a bit faster.
 
 .. index:: Upgrading; 2.4.0 to 2.5.0
 

Roundup Issue Tracker: http://roundup-tracker.org/