Skip to content

Commit 145edad

Browse files
committed
Merge pull request #101 from longshanksmo/bug/xvar
add xvar
2 parents 853af84 + 4b57e2f commit 145edad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/qiniu/api/io/IoApi.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.InputStream;
66
import java.io.UnsupportedEncodingException;
77
import java.nio.charset.Charset;
8+
import java.util.Map;
89
import java.util.zip.CRC32;
910
import java.util.zip.CheckedInputStream;
1011

@@ -43,7 +44,13 @@ private static PutRet put(String uptoken, String key, File file,
4344
return new PutRet(new CallRet(400, new Exception("no crc32 specified!")));
4445
}
4546
requestEntity.addPart("crc32", new StringBody(extra.crc32 + ""));
46-
}
47+
}
48+
49+
if (extra.params != null) {
50+
for (Map.Entry<String, String> xvar : extra.params.entrySet()) {
51+
requestEntity.addPart(xvar.getKey(), new StringBody(xvar.getValue()));
52+
}
53+
}
4754
} catch (Exception e) {
4855
e.printStackTrace();
4956
return new PutRet(new CallRet(400, e));

0 commit comments

Comments
 (0)