File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
asset-manager/web/src/main
java/com/microsoft/migration/assets/service Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,8 @@ private String extractFilename(String key) {
146146 }
147147
148148 private String generateUrl (String key ) {
149- GetUrlRequest request = GetUrlRequest .builder ()
150- .bucket (bucketName )
151- .key (key )
152- .build ();
153- return s3Client .utilities ().getUrl (request ).toString ();
149+ // Use application proxy URL for consistent behavior across storage types
150+ return "/s3/view/" + key ;
154151 }
155152
156153 private String generateKey (String filename ) {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ <h2>Your Images</h2>
77 < div class ="row mt-4 " id ="imageContainer " th:if ="${not #lists.isEmpty(objects)} ">
88 < div class ="col-md-4 mb-4 " th:each ="object : ${objects} " th:attr ="data-key=${object.key} ">
99 < div class ="card ">
10- < img th:src ="${object.url } " class ="card-img-top " alt ="Image preview " style ="height: 200px; object-fit: cover; ">
10+ < img th:src ="@{'/s3/view/' + ${object.key} } " class ="card-img-top " alt ="Image preview " style ="height: 200px; object-fit: cover; ">
1111 < div class ="card-body ">
1212 < h5 class ="card-title text-truncate " th:text ="${object.name} "> Image name</ h5 >
1313 < p class ="card-text ">
Original file line number Diff line number Diff line change 1818 < div class ="card-header d-flex justify-content-between align-items-center ">
1919 < h3 class ="card-title mb-0 " th:text ="${object.name} "> Image Name</ h3 >
2020 < div >
21- < a th:href ="${object.url } " download class ="btn btn-outline-primary btn-sm me-2 ">
21+ < a th:href ="@{'/s3/view/' + ${object.key} } " download class ="btn btn-outline-primary btn-sm me-2 ">
2222 < i class ="bi bi-download "> </ i > Download
2323 </ a >
2424 < form th:action ="@{'/s3/delete/' + ${object.key}} " method ="post " class ="d-inline "
@@ -30,7 +30,7 @@ <h3 class="card-title mb-0" th:text="${object.name}">Image Name</h3>
3030 </ div >
3131 </ div >
3232 < div class ="card-body text-center ">
33- < img th:src ="${object.url } " class ="img-fluid " alt ="Image preview " style ="max-height: 70vh; ">
33+ < img th:src ="@{'/s3/view/' + ${object.key} } " class ="img-fluid " alt ="Image preview " style ="max-height: 70vh; ">
3434 </ div >
3535 < div class ="card-footer ">
3636 < div class ="row ">
You can’t perform that action at this time.
0 commit comments