Skip to content

Commit e725275

Browse files
committed
CORS test
1 parent a68343f commit e725275

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main/kotlin/no/nav/klage/document/api/DocumentController.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*
1414
import java.util.*
1515

1616
@RestController
17+
@CrossOrigin(methods = [RequestMethod.GET, RequestMethod.DELETE, RequestMethod.HEAD, RequestMethod.POST, RequestMethod.OPTIONS, RequestMethod.PUT])
1718
@Api(tags = ["kabal-smart-editor-api"])
1819
@RequestMapping("/documents")
1920
class DocumentController(
@@ -31,7 +32,6 @@ class DocumentController(
3132
notes = "Create document"
3233
)
3334
@PostMapping("")
34-
@CrossOrigin
3535
fun createDocument(
3636
@RequestBody json: String
3737
): DocumentView {
@@ -44,7 +44,6 @@ class DocumentController(
4444
notes = "Update document"
4545
)
4646
@PutMapping("/{documentId}")
47-
@CrossOrigin
4847
fun updateDocument(
4948
@PathVariable("documentId") documentId: UUID,
5049
@RequestBody json: String
@@ -58,7 +57,6 @@ class DocumentController(
5857
notes = "Get document"
5958
)
6059
@GetMapping("/{documentId}")
61-
@CrossOrigin
6260
fun getDocument(@PathVariable("documentId") documentId: UUID): DocumentView {
6361
logger.debug("getDocument")
6462
return mapToDocumentView(documentService.getDocument(documentId))
@@ -69,7 +67,6 @@ class DocumentController(
6967
notes = "Create comment for a given document"
7068
)
7169
@PostMapping("/{documentId}/comments")
72-
@CrossOrigin
7370
fun createComment(
7471
@PathVariable("documentId") documentId: UUID,
7572
@RequestBody commentInput: CommentInput
@@ -90,7 +87,6 @@ class DocumentController(
9087
notes = "Get all comments for a given document"
9188
)
9289
@GetMapping("/{documentId}/comments")
93-
@CrossOrigin
9490
fun getAllCommentsWithPossibleThreads(
9591
@PathVariable("documentId") documentId: UUID
9692
): List<CommentView> {
@@ -103,7 +99,6 @@ class DocumentController(
10399
notes = "Reply to a given comment"
104100
)
105101
@PostMapping("/{documentId}/comments/{commentId}/replies")
106-
@CrossOrigin
107102
fun replyToComment(
108103
@PathVariable("documentId") documentId: UUID,
109104
@PathVariable("commentId") commentId: UUID,
@@ -126,7 +121,6 @@ class DocumentController(
126121
notes = "Get a given comment"
127122
)
128123
@GetMapping("/{documentId}/comments/{commentId}")
129-
@CrossOrigin
130124
fun getCommentWithPossibleThread(
131125
@PathVariable("documentId") documentId: UUID,
132126
@PathVariable("commentId") commentId: UUID

0 commit comments

Comments
 (0)