]> Lady’s Gitweb - HOMEDIR/commitdiff
Add minimal support for t·e·i files
authorLady <redacted>
Sat, 12 Sep 2026 22:36:43 +0000 (18:36 -0400)
committerLady <redacted>
Sat, 12 Sep 2026 22:36:43 +0000 (18:36 -0400)
Message-type: text/lesml

rb/public-serve.rb

index a2866427c577b2e94ec27778fdc57bb24464904504a3cdc4a9cbe2370f3b13e1..801fe1eaf4ea04e815c5bad854e9a913ba815eb156c67b240f574fcae2d5357c 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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
 
@@ -38,6 +38,18 @@ class XHTMLHandler < WEBrick::HTTPServlet::DefaultFileHandler
 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
This page took 0.316777 seconds and 4 git commands to generate.