#!/usr/bin/ruby
-# @(#)🏠📂 HOMEDIR rb/public-serve.rb 2026-03-22T02:03:39Z
+# @(#)🏠📂 HOMEDIR rb/public-serve.rb 2026-09-12T22:36:43Z
# SPDX-FileCopyrightText: 2025, 2026 Lady <https://www.ladys.computer/about/#lady>
# SPDX-License-Identifier: CC0-1.0
end
WEBrick::HTTPServlet::FileHandler.add_handler("xhtml", XHTMLHandler)
+## A minimal T·E·I file handler is provided which serves files with an
+## `application/xml´ media type (browsers are not expected to support
+## `application/tei+xml´).
+
+class TEIHandler < WEBrick::HTTPServlet::DefaultFileHandler
+ def do_GET request, response
+ super
+ response['Content-Type'] = 'application/xml'
+ end
+end
+WEBrick::HTTPServlet::FileHandler.add_handler("tei", TEIHandler)
+
## A notice is printed before starting the server to clarify usage.
$stderr.puts <<INFOTEXT