Skip to content

Commit

Permalink
Working terrible blog
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Oct 24, 2019
1 parent 6a8255a commit b328806
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions src/ApiUtils.java
Expand Up @@ -179,10 +179,15 @@ public static SignedMessage getContentFromJson(JSONObject input, ChannelNode nod
{
ContentInfo.Builder ci = ContentInfo.newBuilder();

if (input.containsKey("mime_type"))
{
ci.setMimeType( input.get("mime_type").toString() );
}
if (input.containsKey("content"))
{
ci.setContent( ByteString.copyFrom(input.get("content").toString().getBytes()));
ci.setContentLength( ci.getContent().size() );

}
if ((input.containsKey("data_map")) && (input.get("data_map") instanceof JSONObject))
{
Expand Down Expand Up @@ -235,13 +240,13 @@ public static void submitBlock(JSONObject input, ChannelNode node, ChannelContex
{
LinkedList<SignedMessage> content = new LinkedList<>();

if (input.containsKey("content"))
if (input.containsKey("content_list"))
{
JSONArray content_array = (JSONArray) input.get("content");
JSONArray content_array = (JSONArray) input.get("content_list");
for(int i = 0; i<content_array.size(); i++)
{
JSONObject msg = (JSONObject) content_array.get(i);
content.add(getContentFromJson( msg, node, ctx));
content.add(getContentFromJson( msg, node, null));
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/ChannelGlobals.java
Expand Up @@ -2,7 +2,7 @@

public class ChannelGlobals
{
public static final String VERSION = "dev.10.18";
public static final String VERSION = "dev.10.23.3";

public static final String NODE_ADDRESS_STRING="node";
public static final String CHANNEL_ADDRESS_STRING="chan";
Expand Down
2 changes: 1 addition & 1 deletion src/WebServer.java
Expand Up @@ -165,7 +165,7 @@ else if (api_path.equals("/beta/block/submit"))
else if (api_path.equals("/beta/block/tail"))
{
t.getResponseHeaders().add("Content-type","application/json");
print_out.println(ApiUtils.getBlockTail(node, ctx, 10));
print_out.println(ApiUtils.getBlockTail(node, ctx, 100));
}
else if (api_path.equals("/beta/am_i_block_signer"))
{
Expand Down

0 comments on commit b328806

Please sign in to comment.