File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/main/java/in/erail/amazon/lambda Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11package in .erail .amazon .lambda .eventsource ;
22
3+ import com .google .common .net .HttpHeaders ;
4+ import com .google .common .net .MediaType ;
35import in .erail .amazon .lambda .EventSource ;
46import in .erail .glue .common .Util ;
57import io .vertx .core .json .JsonObject ;
@@ -31,7 +33,9 @@ public JsonObject transform(JsonObject pEvent) {
3133
3234 JsonObject newRequest = new JsonObject ()
3335 .put ("path" , s3url )
34- .put ("body" , pEvent .toString ().getBytes ());
36+ .put ("httpMethod" , "POST" )
37+ .put ("body" , pEvent .toString ().getBytes ())
38+ .put ("headers" , new JsonObject ().put (HttpHeaders .CONTENT_TYPE ,MediaType .JSON_UTF_8 .toString ()));
3539
3640 return newRequest ;
3741 }
Original file line number Diff line number Diff line change 11package in .erail .amazon .lambda .service ;
22
33import com .google .common .base .Joiner ;
4+ import com .google .common .base .Preconditions ;
45import in .erail .model .Event ;
56import in .erail .model .RequestEvent ;
67import in .erail .model .ResponseEvent ;
@@ -85,6 +86,10 @@ public Maybe<Event> handle(Event pEvent) {
8586
8687 RequestEvent proxyRequest = pEvent .getRequest ();
8788
89+ Preconditions .checkNotNull (proxyRequest .getPath ());
90+ Preconditions .checkNotNull (proxyRequest .getHttpMethod ());
91+
92+
8893 //Build Request
8994 HttpRequest <Buffer > clientRequest = getWebClient ().requestAbs (proxyRequest .getHttpMethod (), generateURL (proxyRequest ));
9095
You can’t perform that action at this time.
0 commit comments