Skip to content

Commit

Permalink
Merge pull request #60 from indiana-university/honorlock_cors
Browse files Browse the repository at this point in the history
LMSA-9618 - Move the CrossOrigin annotation to the method
  • Loading branch information
maurercw authored Jan 17, 2025
2 parents 8111acc + fe85a7f commit 825f802
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,20 @@
@RestController
@RequestMapping({"/rest/iu/honorlock"})
@Tag(name = "HonorLockRestController", description = "Endpoint for HonorLock")
@CrossOrigin(origins = {"${lms.js.cors.origin}"})
public class HonorLockRestController {

@Autowired
private SisServiceImpl sisService;

/**
* NOTE: CrossOrigin annotation needs to be on this method and not the class in order for it to be properly handled
* by the api-portal
* @param sisCourseId
* @return
*/
@GetMapping(value = "/eligible/{sisCourseId}")
@Operation(summary = "Check if a course is eligible to enable the HonorLock tool")
@CrossOrigin(origins = {"${lms.js.cors.origin}"})
public ResponseEntity<HonorLockEligible> checkEligible(@PathVariable(name = "sisCourseId") String sisCourseId) {
boolean isEligible = sisService.isHonorLockEligible(sisCourseId);
return ResponseEntity.ok().body(new HonorLockEligible(isEligible));
Expand Down

0 comments on commit 825f802

Please sign in to comment.