Skip to content

Commit

Permalink
cleaned up PR
Browse files Browse the repository at this point in the history
  • Loading branch information
dutchie032 committed Sep 11, 2024
1 parent 27f4a40 commit 3b7f738
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions lua/DCS-gRPC/grpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,6 @@ end
-- load and start RPC
--

function table_print(tt, indent, done)
done = done or {}
indent = indent or 0
if type(tt) == "table" then
local sb = {}
for key, value in pairs(tt) do
table.insert(sb, string.rep(" ", indent)) -- indent it
if type(value) == "table" and not done[value] then
done[value] = true
table.insert(sb, key .. " = {\n");
table.insert(sb, table_print(value, indent + 2, done))
table.insert(sb, string.rep(" ", indent)) -- indent it
table.insert(sb, "}\n");
elseif "number" == type(key) then
table.insert(sb, string.format("\"%s\"\n", tostring(value)))
else
table.insert(sb, string.format(
"%s = \"%s\"\n", tostring(key), tostring(value)))
end
end
return table.concat(sb)
else
return tt .. "\n"
end
end

if isMissionEnv then
assert(grpc.start({
version = GRPC.version,
Expand Down
2 changes: 1 addition & 1 deletion src/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct AuthInterceptor {
#[async_trait]
impl RequestInterceptor for AuthInterceptor {
async fn intercept(&self, req: Request<Body>) -> Result<Request<Body>, Status> {
match req.headers().get("bearer").map(|v| v.to_str()) {
match req.headers().get("X-API-Key").map(|v| v.to_str()) {
Some(Ok(token)) => {
//check if token is correct if auth is enabled
if self.auth_config.enabled == false || token == self.auth_config.token {
Expand Down

0 comments on commit 3b7f738

Please sign in to comment.