Troubleshooting multipart
This commit is contained in:
parent
077963ae28
commit
a700cf2863
4 changed files with 34 additions and 11 deletions
|
|
@ -120,7 +120,7 @@ public class MultipartParser implements Iterable<MultipartField>{
|
|||
public boolean hasNext() {
|
||||
try {
|
||||
IOUtil.copyStream(buffIn, new NullWriter());
|
||||
return boundaryIn.hasNext();
|
||||
return boundaryIn.next();
|
||||
} catch (IOException e){
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
}
|
||||
|
|
@ -133,8 +133,11 @@ public class MultipartParser implements Iterable<MultipartField>{
|
|||
if (!hasNext())
|
||||
return null;
|
||||
try {
|
||||
boundaryIn.next(); // Skip current boundary
|
||||
HttpHeader header = parser.read();
|
||||
String tmp = buffIn.readLine(); // read the new line after the delimiter
|
||||
if (tmp == null && tmp.equals("--"))
|
||||
return null;
|
||||
|
||||
String disposition = header.getHeader(HEADER_CONTENT_DISPOSITION);
|
||||
if (disposition != null){
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue