0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::resource: Add a node_id to the resource request struct.

This commit is contained in:
Jason Volk 2018-05-18 19:31:44 -07:00
parent ba4b3fa145
commit fc3fd6a8b2
2 changed files with 5 additions and 1 deletions

View file

@ -94,6 +94,7 @@ struct ircd::resource::request
vector_view<string_view> parv;
string_view param[8];
m::user::id::buf user_id;
m::node::id::buf node_id;
request(const http::request::head &head,
const string_view &content)
@ -116,6 +117,7 @@ struct ircd::resource::request::object
const http::query::string &query;
const decltype(r.origin) &origin;
const decltype(r.user_id) &user_id;
const decltype(r.node_id) &node_id;
const decltype(r.access_token) &access_token;
const vector_view<string_view> &parv;
const json::object &body;
@ -128,6 +130,7 @@ struct ircd::resource::request::object
,query{r.query}
,origin{r.origin}
,user_id{r.user_id}
,node_id{r.node_id}
,access_token{r.access_token}
,parv{r.parv}
,body{r}

View file

@ -207,7 +207,8 @@ try
object.verify(x_matrix.key, x_matrix.sig)
};
request.origin = x_matrix.origin;
request.node_id = {"", x_matrix.origin};
request.origin = request.node_id.host();
return verified;
}
catch(const std::exception &e)