Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add support for Apache storage backend #1

merged 1 commit into from

2 participants



We are using Moji with a MogileFS cluster that uses Apache as its storage backend.
And we found Apache returns 201 instead of 200 when the file was created, and it makes FileUploadOutputStream throws an IOException even the file has been uploaded to storage node correctly.

A patch for this issue is attached. I think this can help others who also using Apache as their MogileFS storage backend.

  • CC
@teabot teabot merged commit 93863fd into lastfm:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2012
  1. Support for storage backend like Apache that reponses a "201 Created"…

    Edward Feng authored CC Lien committed
    … instead of "200 OK"
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/main/java/fm/last/moji/impl/
2  src/main/java/fm/last/moji/impl/
@@ -92,7 +92,7 @@ public void close() throws IOException {
try {
String message = httpConnection.getResponseMessage();
int code = httpConnection.getResponseCode();
- if (HttpURLConnection.HTTP_OK != code) {
+ if (HttpURLConnection.HTTP_OK != code && HttpURLConnection.HTTP_CREATED != code ) {
throw new IOException(code + " " + message);
} else {
log.debug("Status: HTTP {} - {}", code, message);
Something went wrong with that request. Please try again.