From 913a7503766dfbc3a8c5a7a4bb53a12a801b92b9 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 17:14:52 +0100 Subject: [PATCH] update simple-httpd --- .../simple-httpd-pkg.el | 2 - .../simple-httpd-autoloads.el | 11 ++---- .../simple-httpd-pkg.el | 2 + .../simple-httpd.el | 38 +++++++------------ 4 files changed, 19 insertions(+), 34 deletions(-) delete mode 100644 elpa/simple-httpd-20190110.1505/simple-httpd-pkg.el rename elpa/{simple-httpd-20190110.1505 => simple-httpd-20191006.1956}/simple-httpd-autoloads.el (71%) create mode 100644 elpa/simple-httpd-20191006.1956/simple-httpd-pkg.el rename elpa/{simple-httpd-20190110.1505 => simple-httpd-20191006.1956}/simple-httpd.el (97%) diff --git a/elpa/simple-httpd-20190110.1505/simple-httpd-pkg.el b/elpa/simple-httpd-20190110.1505/simple-httpd-pkg.el deleted file mode 100644 index 703007b2..00000000 --- a/elpa/simple-httpd-20190110.1505/simple-httpd-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "simple-httpd" "20190110.1505" "pure elisp HTTP server" '((cl-lib "0.3")) :commit "08535d0fad6a32fdc03d725ec74e10a754bb9c7a" :authors '(("Christopher Wellons" . "wellons@nullprogram.com")) :maintainer '("Christopher Wellons" . "wellons@nullprogram.com") :url "https://github.com/skeeto/emacs-http-server") diff --git a/elpa/simple-httpd-20190110.1505/simple-httpd-autoloads.el b/elpa/simple-httpd-20191006.1956/simple-httpd-autoloads.el similarity index 71% rename from elpa/simple-httpd-20190110.1505/simple-httpd-autoloads.el rename to elpa/simple-httpd-20191006.1956/simple-httpd-autoloads.el index a042623f..287ff524 100644 --- a/elpa/simple-httpd-20190110.1505/simple-httpd-autoloads.el +++ b/elpa/simple-httpd-20191006.1956/simple-httpd-autoloads.el @@ -1,12 +1,10 @@ ;;; simple-httpd-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "simple-httpd" "simple-httpd.el" (0 0 0 0)) +;;;### (autoloads nil "simple-httpd" "simple-httpd.el" (23994 46381 +;;;;;; 779474 32000)) ;;; Generated autoloads from simple-httpd.el (autoload 'httpd-start "simple-httpd" "\ @@ -31,14 +29,11 @@ Start the web server with given `directory' as `httpd-root'. \(fn DIRECTORY)" t nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "simple-httpd" '("httpd" "defservlet" "with-httpd-buffer"))) - ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; simple-httpd-autoloads.el ends here diff --git a/elpa/simple-httpd-20191006.1956/simple-httpd-pkg.el b/elpa/simple-httpd-20191006.1956/simple-httpd-pkg.el new file mode 100644 index 00000000..b91586cf --- /dev/null +++ b/elpa/simple-httpd-20191006.1956/simple-httpd-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "simple-httpd" "20191006.1956" "pure elisp HTTP server" '((cl-lib "0.3")) :commit "67f2f1e665fa66d7ef3beed8e82f94962bfa4f3b" :authors '(("Christopher Wellons" . "wellons@nullprogram.com")) :maintainer '("Christopher Wellons" . "wellons@nullprogram.com") :url "https://github.com/skeeto/emacs-http-server") diff --git a/elpa/simple-httpd-20190110.1505/simple-httpd.el b/elpa/simple-httpd-20191006.1956/simple-httpd.el similarity index 97% rename from elpa/simple-httpd-20190110.1505/simple-httpd.el rename to elpa/simple-httpd-20191006.1956/simple-httpd.el index ebf3ca09..4c75a840 100644 --- a/elpa/simple-httpd-20190110.1505/simple-httpd.el +++ b/elpa/simple-httpd-20191006.1956/simple-httpd.el @@ -4,7 +4,7 @@ ;; Author: Christopher Wellons ;; URL: https://github.com/skeeto/emacs-http-server -;; Package-Version: 20190110.1505 +;; Package-Version: 20191006.1956 ;; Version: 1.5.1 ;; Package-Requires: ((cl-lib "0.3")) @@ -206,16 +206,16 @@ ("tiff" . "image/tiff") ("ico" . "image/x-icon") ("svg" . "image/svg+xml") - ("css" . "text/css") - ("htm" . "text/html") - ("html" . "text/html") - ("xml" . "text/xml") - ("rss" . "text/xml") - ("atom" . "text/xml") - ("txt" . "text/plain") - ("el" . "text/plain") - ("js" . "text/javascript") - ("md" . "text/x-markdown") + ("css" . "text/css; charset=utf-8") + ("htm" . "text/html; charset=utf-8") + ("html" . "text/html; charset=utf-8") + ("xml" . "text/xml; charset=utf-8") + ("rss" . "text/xml; charset=utf-8") + ("atom" . "text/xml; charset=utf-8") + ("txt" . "text/plain; charset=utf-8") + ("el" . "text/plain; charset=utf-8") + ("js" . "text/javascript; charset=utf-8") + ("md" . "text/x-markdown; charset=utf-8") ("gz" . "application/octet-stream") ("ps" . "application/postscript") ("eps" . "application/postscript") @@ -350,7 +350,6 @@ instance per Emacs instance." :host httpd-host :family httpd-ip-family :filter 'httpd--filter - :filter-multibyte nil :coding 'binary :log 'httpd--log) (run-hooks 'httpd-start-hook)) @@ -433,7 +432,7 @@ emacs -Q -batch -l simple-httpd.elc -f httpd-batch-start" (let* ((content (buffer-string)) (uri (cl-cadar request)) (parsed-uri (httpd-parse-uri (concat uri))) - (uri-path (nth 0 parsed-uri)) + (uri-path (httpd-unhex (nth 0 parsed-uri))) (uri-query (append (nth 1 parsed-uri) (httpd-parse-args content))) (servlet (httpd-get-servlet uri-path))) @@ -456,7 +455,6 @@ emacs -Q -batch -l simple-httpd.elc -f httpd-batch-start" (defun httpd--log (server proc message) "Runs each time a new client connects." (with-current-buffer (generate-new-buffer " *httpd-client*") - (set-buffer-multibyte nil) (process-put proc :request-buffer (current-buffer))) (set-process-sentinel proc #'httpd--sentinel) (httpd-log (list 'connection (car (process-contact proc))))) @@ -830,7 +828,6 @@ the `httpd-current-proc' as the process." (httpd-send-header proc "text/plain" 304)) (httpd-log `(file ,path)) (with-temp-buffer - (set-buffer-multibyte nil) (insert-file-contents path) (httpd-send-header proc (httpd-get-mime (file-name-extension path)) 200 :Last-Modified mtime :ETag etag))))) @@ -844,7 +841,6 @@ the `httpd-current-proc' as the process." (if (equal "/" (substring uri-path -1)) (with-temp-buffer (httpd-log `(directory ,path)) - (set-buffer-multibyte nil) (insert "\n") (insert "\n" title "\n") (insert "\n

" title "

\n
\n\n
\n\n") - (httpd-send-header proc "text/html" 200)) + (httpd-send-header proc "text/html; charset=utf-8" 200)) (httpd-redirect proc (concat uri-path "/"))))) (defun httpd--buffer-size (&optional buffer) "Get the buffer size in bytes." - (let ((orig enable-multibyte-characters) - (size 0)) - (with-current-buffer (or buffer (current-buffer)) - (set-buffer-multibyte nil) - (setf size (buffer-size)) - (if orig (set-buffer-multibyte orig))) - size)) + (bufferpos-to-filepos (point-max))) (defun httpd-error (proc status &optional info) "Send an error page appropriate for STATUS to the client, -- 2.47.3