Skip to content

Commit

Permalink
[feat] host경로 확인 controller작성
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiwon committed Jul 25, 2023
1 parent 2f4a2ab commit e91b0dd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class CopyController {


// 전체 카피라이팅 조회
@GetMapping("/{index}")
@GetMapping("/{index}") //copy/0=> 0-30 copy/1=>0~30 copy/2=>60~90 copy/9 => 270~300
public HttpRes<List<CopyRes>> copyList(HttpServletRequest httpRequest,@PathVariable int index) {
Long[] brandIds = {2L, 3L, 4L, 12L, 15L, 17L, 21L, 24L, 25L, 28L};

Expand Down
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";
}
}

0 comments on commit e91b0dd

Please sign in to comment.