Przeglądaj źródła

Setting Content-Type and sending request for SnapshotPushRequest.

Winston Li 12 lat temu
rodzic
commit
87bd7e6ff4

+ 1 - 1
services/git-bridge/src/uk/ac/ic/wlgitbridge/writelatex/WriteLatexAPI.java

@@ -45,7 +45,7 @@ public class WriteLatexAPI implements WriteLatexDataSource {
     @Override
     @Override
     public void putDirectoryContentsToProjectWithName(String projectName, RawDirectoryContents directoryContents, String remoteAddr) throws SnapshotPostException, IOException, FailedConnectionException {
     public void putDirectoryContentsToProjectWithName(String projectName, RawDirectoryContents directoryContents, String remoteAddr) throws SnapshotPostException, IOException, FailedConnectionException {
         CandidateSnapshot candidate = dataModel.createCandidateSnapshotFromProjectWithContents(projectName, directoryContents, remoteAddr);
         CandidateSnapshot candidate = dataModel.createCandidateSnapshotFromProjectWithContents(projectName, directoryContents, remoteAddr);
-        new SnapshotPushRequest(candidate);
+        new SnapshotPushRequest(candidate).request();
         throw new SnapshotPostException() {
         throw new SnapshotPostException() {
 
 
             @Override
             @Override

+ 1 - 1
services/git-bridge/src/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Request.java

@@ -67,7 +67,7 @@ public abstract class Request<T extends Result> {
     }
     }
 
 
     private void performPostRequest() {
     private void performPostRequest() {
-        request(new AsyncHttpClient().preparePost(url).setBody(getPostBody()));
+        request(new AsyncHttpClient().preparePost(url).setBody(getPostBody()).setHeader("Content-Type", "application/json"));
     }
     }
 
 
     private void request(BoundRequestBuilder boundRequestBuilder) {
     private void request(BoundRequestBuilder boundRequestBuilder) {