NetBSD Problem Report #57962

From www@netbsd.org  Mon Feb 26 16:50:03 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0DD1F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 26 Feb 2024 16:50:03 +0000 (UTC)
Message-Id: <20240226165001.83AE21A923A@mollari.NetBSD.org>
Date: Mon, 26 Feb 2024 16:50:01 +0000 (UTC)
From: dbohdan@sdf.org
Reply-To: dbohdan@sdf.org
To: gnats-bugs@NetBSD.org
Subject: bozohttpd directory listings aren't mobile-friendly
X-Send-Pr-Version: www-1.0

>Number:         57962
>Category:       bin
>Synopsis:       bozohttpd directory listings aren't mobile-friendly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          pending-pullups
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 26 16:55:00 +0000 2024
>Closed-Date:    
>Last-Modified:  Fri Apr 26 21:31:07 +0000 2024
>Originator:     D. Bohdan
>Release:        -CURRENT
>Organization:
>Environment:
>Description:
A typical mobile browser on a smartphone assumes a page without a "viewport"
<meta> tag is designed for desktop browsers. It displays the page in a
virtual window that simulates a wider screen and does not adjust it for
the phone's pixel density. The usual result is that the content on the page
looks small, and interacting with the page comfortably and precisely requires
zoom. This is currently the case with bozohttpd directory listing pages. Here
is what one looks like in Firefox for Android:
https://paste.dbohdan.com/bozohttpd-before.1708956152.png

Adding a standard <meta> "viewport" tag makes the page look much more at home
on a phone:
https://paste.dbohdan.com/bozohttpd-after.1708956152.png
The updated page can be used without zoom. This does not affect desktop
browsing. It also doesn't require changes to the rest of the HTML markup.
>How-To-Repeat:

>Fix:
Index: src/libexec/httpd/dir-index-bozo.c
===================================================================
RCS file: /cvsroot/src/libexec/httpd/dir-index-bozo.c,v
retrieving revision 1.36
diff -u -r1.36 dir-index-bozo.c
--- src/libexec/httpd/dir-index-bozo.c	18 May 2022 00:37:11 -0000	1.36
+++ src/libexec/httpd/dir-index-bozo.c	26 Feb 2024 13:37:37 -0000
@@ -123,6 +123,7 @@
 	bozo_printf(httpd,
 		"<!DOCTYPE html>\r\n"
 		"<html><head><meta charset=\"utf-8\"/>\r\n"
+		"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n"
 		"<style type=\"text/css\">\r\n"
 		"table {\r\n"
 		"\tborder-top: 1px solid black;\r\n"

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->needs-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 26 Apr 2024 20:27:54 +0000
State-Changed-Why:
Thanks for the patch. We should probably have it in -10 too.


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57962 CVS commit: src/libexec/httpd
Date: Fri, 26 Apr 2024 20:27:12 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Fri Apr 26 20:27:12 UTC 2024

 Modified Files:
 	src/libexec/httpd: dir-index-bozo.c

 Log Message:
 Create mobile-friendly directory listings

 A typical mobile browser on a smartphone assumes a page without a "viewport"
 <meta> tag is designed for desktop browsers. It displays the page in a
 virtual window that simulates a wider screen and does not adjust it for
 the phone's pixel density. The usual result is that the content on the page
 looks small, and interacting with the page comfortably and precisely requires
 zoom. This is currently the case with bozohttpd directory listing pages.

 from D. Bohdan in PR bin/57962


 To generate a diff of this commit:
 cvs rdiff -u -r1.36 -r1.37 src/libexec/httpd/dir-index-bozo.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 26 Apr 2024 21:31:07 +0000
State-Changed-Why:
pullup-10 #680


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.