Skip to content

Commit

Permalink
Add Location to exposed headers in CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Jul 10, 2024
1 parent d1a9ab9 commit f1523af
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
Expand Down Expand Up @@ -62,6 +63,12 @@ public class UploadController {
"/" + PathsUtil.FILE_PATH +
"/" + PathsUtil.TOPIC_PATH + "/" + PathsUtil.TOPIC_ID_CONSTANT +
"/upload")
@CrossOrigin(
origins = "*",
allowedHeaders = "*",
exposedHeaders = "Location", // needed to get the URI of the uploaded file in aRMT
methods = { RequestMethod.POST }
)
public ResponseEntity<?> subjectFileUpload(
@RequestParam("file") MultipartFile file,
@PathVariable String projectId,
Expand Down

0 comments on commit f1523af

Please sign in to comment.