Polishing
This commit is contained in:
parent
4384c1ae50
commit
86ea3059b6
|
@ -20,7 +20,6 @@ import java.io.PrintWriter;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
@ -63,6 +62,7 @@ public class EmbeddedDatabaseFactory {
|
||||||
*/
|
*/
|
||||||
public static final String DEFAULT_DATABASE_NAME = "testdb";
|
public static final String DEFAULT_DATABASE_NAME = "testdb";
|
||||||
|
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(EmbeddedDatabaseFactory.class);
|
private static final Log logger = LogFactory.getLog(EmbeddedDatabaseFactory.class);
|
||||||
|
|
||||||
private String databaseName = DEFAULT_DATABASE_NAME;
|
private String databaseName = DEFAULT_DATABASE_NAME;
|
||||||
|
|
|
@ -155,12 +155,15 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||||
*/
|
*/
|
||||||
public List<MediaType> getAccept() {
|
public List<MediaType> getAccept() {
|
||||||
String value = getFirst(ACCEPT);
|
String value = getFirst(ACCEPT);
|
||||||
List<MediaType> result = (value != null) ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList();
|
List<MediaType> result = (value != null ? MediaType.parseMediaTypes(value) : Collections.<MediaType>emptyList());
|
||||||
|
|
||||||
// Some containers parse 'Accept' into multiple values
|
// Some containers parse 'Accept' into multiple values
|
||||||
if ((result.size() == 1) && (get(ACCEPT).size() > 1)) {
|
if (result.size() == 1) {
|
||||||
value = StringUtils.collectionToCommaDelimitedString(get(ACCEPT));
|
List<String> acceptHeader = get(ACCEPT);
|
||||||
result = MediaType.parseMediaTypes(value);
|
if (acceptHeader.size() > 1) {
|
||||||
|
value = StringUtils.collectionToCommaDelimitedString(acceptHeader);
|
||||||
|
result = MediaType.parseMediaTypes(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue