Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write header Proxy-Authorization before read-status-line to avoid HTTP status code 407 #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion request.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,12 @@ Any encodings in Transfer-Encoding, such as chunking, are always performed."
(puri:uri-host uri)
(puri:uri-is-ip6 uri)
(puri:uri-port uri))
(when (and proxy proxy-basic-authorization)
(write-header "Proxy-Authorization" "Basic ~A"
(base64:string-to-base64-string
(format nil "~A:~A"
(first proxy-basic-authorization)
(second proxy-basic-authorization)))))
(write-http-line "")
(force-output http-stream)
;; check we get a 200 response before proceeding
Expand Down Expand Up @@ -702,7 +708,7 @@ Any encodings in Transfer-Encoding, such as chunking, are always performed."
(format nil "~A:~A"
(first basic-authorization)
(second basic-authorization)))))
(when (and proxy proxy-basic-authorization)
(when (and proxy proxy-basic-authorization (not proxying-https-p))
(write-header "Proxy-Authorization" "Basic ~A"
(base64:string-to-base64-string
(format nil "~A:~A"
Expand Down