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

varnishncsa cannot decode Authorization header if the format is incorrect. #2148

Closed
iamkelvinloke opened this Issue Nov 27, 2016 · 1 comment

Comments

Projects
None yet
4 participants
@iamkelvinloke

iamkelvinloke commented Nov 27, 2016

Expected Behavior

For below Authorization headers, varnishncsa should decode the string properly.

Authorization: Basic aWFta2VsdmlubG9rZTo5ODMzMjIxMQ==
Authorization:Basic aWFta2VsdmlubG9rZTo5ODMzMjIxMQ==

Current Behavior

When there isn't any space between : and Basic, varnishncsa is not able to decode the string.

Authorization: Basic aWFta2VsdmlubG9rZTo5ODMzMjIxMQ==

Able to decode

Authorization:Basic aWFta2VsdmlubG9rZTo5ODMzMjIxMQ==

Not able to decode

Possible Solution

We could possibly add in a code handling to be able to parse the Authorization header?

Steps to Reproduce (for bugs)

curl -X GET -H "Authorization:Basic aWFta2VsdmlubG9rZTo5ODMzMjIxMQ==" "http://api.placeholder.com/test"

The log format is %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"

Varnishncsa is not able to decode the Authorization header to %u (result below).

111.111.111.111 - - [27/Nov/2016:22:51:47 +0800] "GET http://api.placeholder.com/test HTTP/1.1" 200 390710 "-" "curl/7.35.0"

My Environment

Ubuntu 14.04
Varnish 4.1.3.1

@hermunn

This comment has been minimized.

Show comment
Hide comment
@hermunn

hermunn Dec 7, 2016

Contributor

Backport review: Backported as d8810a8

Contributor

hermunn commented Dec 7, 2016

Backport review: Backported as d8810a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment