Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.

Commit

Permalink
Test API "This request is only accepted using POST!" Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rico666 committed Jan 2, 2019
1 parent f9e79fe commit 0cae253
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/brs/http/APITag.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public enum APITag {
ACCOUNTS("Accounts"), ALIASES("Aliases"), AE("Asset Exchange"), CREATE_TRANSACTION("Create Transaction"),
BLOCKS("Blocks"), DGS("Digital Goods Store"), FORGING("Forging"), INFO("Server Info"), MESSAGES("Messages"),
MINING("Mining"), TRANSACTIONS("Transactions"), TOKENS("Tokens"), VS("Voting System"), AT("Automated Transaction"),
FEES("Fees"), UTILS("Utils"), DEBUG("Debug");
FEES("Fees"), UTILS("Utils"), DEBUG("Debug"), PEER_INFO("Server Peer Info");

private final String displayName;

Expand Down
2 changes: 1 addition & 1 deletion src/brs/http/APITestServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class APITestServlet extends HttpServlet {
+ " }\n"
+ " $.ajax({\n"
+ " url: url,\n"
+ " type: 'GET',\n"
+ " type: 'POST',\n"
+ " })\n"
+ " .done(function(result) {\n"
+ " var resultStr = JSON.stringify(JSON.parse(result), null, 4);\n"
Expand Down
2 changes: 1 addition & 1 deletion src/brs/http/GetMyPeerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public final class GetMyPeerInfo extends APIServlet.APIRequestHandler {
private final TransactionProcessor transactionProcessor;

public GetMyPeerInfo(BlockchainProcessor blockchainProcessor, TransactionProcessor transactionProcessor) {
super(new APITag[]{APITag.INFO});
super(new APITag[]{APITag.PEER_INFO});
this.blockchainProcessor = blockchainProcessor;
this.transactionProcessor = transactionProcessor;
}
Expand Down
3 changes: 2 additions & 1 deletion src/brs/peer/Peers.java
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,8 @@ private static void feedPeer(Peer peer, Function<Peer, List<Transaction>> foodDi
if(response != null && response.get("error") == null) {
doneFeedingLog.accept(peer, transactionsToSend);
} else {
logger.warn("Error feeding {} transactions: {} error: {}", peer.getPeerAddress(), transactionsToSend.stream().map(t -> t.getId()).collect(Collectors.toList()), response);
logger.warn("Error feeding {} transactions: {} error: {} - removing peer for now.", peer.getPeerAddress(), transactionsToSend.stream().map(t -> t.getId()).collect(Collectors.toList()), response);
peer.remove();
}
} else {
logger.trace("No need to feed {}", peer.getPeerAddress());
Expand Down

0 comments on commit 0cae253

Please sign in to comment.