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

Nginx::Request#authority doesn't return userinfo #410

Open
yyamano opened this issue Nov 28, 2018 · 3 comments
Open

Nginx::Request#authority doesn't return userinfo #410

yyamano opened this issue Nov 28, 2018 · 3 comments

Comments

@yyamano
Copy link
Collaborator

yyamano commented Nov 28, 2018

Nginx::Request#authority doesn't return userinfo.

% curl http://yyamano:pass@localhost:58080/authority
localhost:58080
% curl http://localhost:58080/authority
localhost:58080
        location /authority {
          mruby_content_handler_code 'Nginx.rputs Nginx::Request.new.authority.to_s';
        }

It just returns HOST header field that contains only host and port.

static mrb_value ngx_mrb_get_request_var_authority(mrb_state *mrb, mrb_value self)
{
  mrb_value v = ngx_mrb_get_request_var(mrb, self);
  return mrb_funcall(mrb, v, "http_host", 0, NULL);
}

https://tools.ietf.org/html/rfc7230#section-5.4

   The "Host" header field in a request provides the host and port
   information from the target URI, enabling the origin server to
   distinguish among resources while servicing requests for multiple
   host names on a single IP address.

     Host = uri-host [ ":" port ] ; Section 2.7.1
@yyamano
Copy link
Collaborator Author

yyamano commented Nov 29, 2018

@matsumotory
Copy link
Owner

You should also see HTTP/2 specification like https://tools.ietf.org/html/rfc7540#section-10.1

@matsumotory
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants