Skip to content

Commit

Permalink
Merge branch 'master' of github.com:edicl/drakma
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuebner committed Oct 4, 2013
2 parents 2732ae1 + 5a11578 commit 06a59ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages.lisp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#:*body-format-function* #:*body-format-function*
#:*remove-duplicate-cookies-p* #:*remove-duplicate-cookies-p*
#:*default-http-proxy* #:*default-http-proxy*
#:*no-proxy-domains*
#:*drakma-default-external-format* #:*drakma-default-external-format*
#:*header-stream* #:*header-stream*
#:*ignore-unparseable-cookie-dates-p* #:*ignore-unparseable-cookie-dates-p*
Expand Down
12 changes: 11 additions & 1 deletion request.lisp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ headers of the chunked stream \(if any) as a second value."
(accept "*/*") (accept "*/*")
range range
(proxy *default-http-proxy*) (proxy *default-http-proxy*)
(no-proxy-domains *no-proxy-domains*)
proxy-basic-authorization proxy-basic-authorization
real-host real-host
additional-headers additional-headers
Expand Down Expand Up @@ -376,7 +377,13 @@ integer denoting the port to use \(which will default to 80
otherwise). Defaults to *default-http-proxy*. otherwise). Defaults to *default-http-proxy*.
PROXY-BASIC-AUTHORIZATION is used like PROXY-BASIC-AUTHORIZATION is used like
BASIC-AUTHORIZATION, but for the proxy, and only if PROXY is BASIC-AUTHORIZATION, but for the proxy, and only if PROXY is
true. true. If the host portion of the uri is present in the
*no-proxy-domains* or the NO-PROXY-DOMAINS list then the proxy
setting will be ignored for this request.
If NO-PROXY-DOMAINS is set then it will supersede the
*no-proxy-domains* variable. Inserting domains into this list will
allow them to ignore the proxy setting.
If REAL-HOST is not NIL, request is sent to the denoted host instead If REAL-HOST is not NIL, request is sent to the denoted host instead
of the URI host. When specified, REAL-HOST supersedes PROXY. of the URI host. When specified, REAL-HOST supersedes PROXY.
Expand Down Expand Up @@ -481,6 +488,9 @@ PARAMETERS will not be used."
(when proxy (when proxy
(when (atom proxy) (when (atom proxy)
(setq proxy (list proxy 80)))) (setq proxy (list proxy 80))))
;; Ignore the proxy for whitelisted hosts.
(when (member (uri-host uri) no-proxy-domains :test #'string=)
(setq proxy '()))
;; make sure we don't get :CRLF on Windows ;; make sure we don't get :CRLF on Windows
(let ((*default-eol-style* :lf) (let ((*default-eol-style* :lf)
(file-parameters-p (find-if-not (lambda (thing) (file-parameters-p (find-if-not (lambda (thing)
Expand Down
3 changes: 3 additions & 0 deletions specials.lisp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ otherwise).")
;; and <http://www.cliki.net/hyperdoc> ;; and <http://www.cliki.net/hyperdoc>
;; also used by LW-ADD-ONS ;; also used by LW-ADD-ONS


(defvar *no-proxy-domains* nil
"A list of domains for which a proxy should not be used.")

(defvar *hyperdoc-base-uri* "http://weitz.de/drakma/") (defvar *hyperdoc-base-uri* "http://weitz.de/drakma/")


(let ((exported-symbols-alist (let ((exported-symbols-alist
Expand Down

0 comments on commit 06a59ae

Please sign in to comment.