From 8ff46dd4c1886c1cda82bbe94306c37a638e6f41 Mon Sep 17 00:00:00 2001 From: William Brown Date: Mon, 19 Nov 2018 06:58:34 +1000 Subject: [PATCH] Unsafe search --- src/log.rs | 3 --- src/main.rs | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/log.rs b/src/log.rs index f6b708c62..1e2411247 100644 --- a/src/log.rs +++ b/src/log.rs @@ -19,9 +19,6 @@ macro_rules! log_event { }) } -// This is the core of the server. It implements all -// the search and modify actions, applies access controls -// and get's everything ready to push back to the fe code // We need to pass in config for this later // Or we need to pass in the settings for it IE level and dest? diff --git a/src/main.rs b/src/main.rs index 1526c97e4..cbe2c67b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ extern crate uuid; // use actix::prelude::*; use actix_web::{ error, http, middleware, App, AsyncResponder, Error, FutureResponse, HttpMessage, HttpRequest, - HttpResponse, Json, Path, State, + HttpResponse, Json, Path, State }; use bytes::BytesMut; @@ -89,6 +89,7 @@ fn search( // FIXME: entries should not be EventResult type Ok(entries) => Ok(HttpResponse::Ok().json(entries)), Err(_) => Ok(HttpResponse::InternalServerError().into()), + // Err(_) => Ok(error::ErrorInternalServerError("Test error").into()), }), ) } @@ -161,6 +162,13 @@ fn main() { // Connect all our end points here. .middleware(middleware::Logger::default()) .resource("/", |r| r.f(index)) + // + /* + .resource("/create", |r| { + r.method(http::Method::POST) + .with(create) + }) + */ // curl --header "Content-Type: application/json" --request POST --data '{ "filter" : { "Eq": ["class", "user"] }}' http://127.0.0.1:8080/search .resource("/search", |r| { r.method(http::Method::POST)