diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/hcel-client.el | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lisp/hcel-client.el b/lisp/hcel-client.el index 68f9507..3a484f6 100644 --- a/lisp/hcel-client.el +++ b/lisp/hcel-client.el @@ -104,13 +104,7 @@ (defun hcel-api-global-references (name) (hcel-url-fetch-json (concat hcel-endpoint "/api/globalReferences/" name))) -(defun http-status (header) - (save-excursion - (goto-char (point-min)) - (string-match "^HTTP.*\\([0-9]\\{3\\}\\).*$" header) - (match-string 1 header))) - -(defun parse-http-header (text) +(defun hcel-parse-http-header (text) (let ((status) (fields)) (with-temp-buffer (insert text) @@ -128,7 +122,7 @@ (with-current-buffer (url-retrieve-synchronously url t) (let ((header) (status) (fields) (json)) (delete-http-header) - (setq header (parse-http-header (car kill-ring)) + (setq header (hcel-parse-http-header (car kill-ring)) status (alist-get 'status header) fields (alist-get 'fields header)) (with-current-buffer hcel-client-buffer-name |