fix url for https
This commit is contained in:
@@ -2,6 +2,9 @@ package marketing.heyday.hartmann.fotodocumentation.rest.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import marketing.heyday.hartmann.fotodocumentation.core.model.Picture;
|
||||
|
||||
@@ -17,15 +20,19 @@ import marketing.heyday.hartmann.fotodocumentation.core.model.Picture;
|
||||
|
||||
@Schema(name = "Picture")
|
||||
public record PictureValue(Long id, String comment, String category, Date pictureDate, String username, Integer evaluation, String imageUrl, String normalSizeUrl, String thumbnailSizeUrl) {
|
||||
private static final Log LOG = LogFactory.getLog(PictureValue.class);
|
||||
|
||||
public static PictureValue builder(Picture picture, String baseUrl) {
|
||||
if (picture == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
LOG.error("baseUrl " + baseUrl);
|
||||
String sizeUrl = baseUrl;
|
||||
if(baseUrl.startsWith("http://)") && !baseUrl.startsWith("http://localhost")){
|
||||
LOG.error("starts with http:// ");
|
||||
sizeUrl = "https://" + baseUrl.substring(8);
|
||||
LOG.error("new baseUrl " + sizeUrl);
|
||||
}
|
||||
|
||||
sizeUrl = sizeUrl + "picture/image/" + picture.getPictureId() + "?size=";
|
||||
|
||||
Reference in New Issue
Block a user