-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jiwon
committed
Jul 25, 2023
1 parent
2f4a2ab
commit e91b0dd
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/shop/hooking/hooking/controller/RefererController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package shop.hooking.hooking.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/example") | ||
public class RefererController { | ||
|
||
@GetMapping("/login") | ||
public String login(HttpServletRequest request) { | ||
// Referer 헤더 확인 | ||
String referer = request.getHeader("Referer"); | ||
System.out.println("Referer: " + referer); | ||
|
||
// Host 헤더 확인 | ||
String host = request.getHeader("Host"); | ||
System.out.println("Host: " + host); | ||
|
||
// 로그인 성공 후 리다이렉트할 URL 분기처리 등 추가 작업 수행 | ||
|
||
return "Login success"; | ||
} | ||
} | ||
|