-
Notifications
You must be signed in to change notification settings - Fork 388
[톰캣 구현하기 1, 2단계] 트레 미션 제출합니다. #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
436e7b0
chore: .gitignore 학습 테스트를 버전 관리하지 않도록 수정
takoyakimchi ae9a4f4
feat: /index.html 응답하기 구현
takoyakimchi 8fd0d5d
refactor: 200 응답 문자열 생성하는 부분을 메서드로 분리
takoyakimchi edab62e
refactor: index.html 이외 다른 파일명이 들어와도 리소스 반환하도록 수정
takoyakimchi 7c28a39
refactor: 메서드명 간결화
takoyakimchi ba2e0fc
feat: 리소스 존재하지 않는 경우 404.html 반환
takoyakimchi 67a27ac
feat: Query String 파싱 구현
takoyakimchi 8a3f7ae
fix: 올바른 Content-Type 지정
takoyakimchi 9fdc595
fix: id, pw 존재하지 않아도 예외 발생하지 않도록 수정, /login으로 로그인 페이지 접속 가능하도록 수정
takoyakimchi ddd688c
refactor: Response Message를 생성하는 메서드에서 상태 코드를 인자로 받도록 수정
takoyakimchi 95d88b2
feat: 로그인 시 리다이렉트 구현
takoyakimchi 5552f95
feat: 로그인을 POST 메서드로 변경
takoyakimchi 67c7fff
feat: 회원가입 구현
takoyakimchi afdf820
fix: .js 파일의 Content-Type 지정
takoyakimchi 344aa3d
feat: HttpCookie 클래스 생성
takoyakimchi 69bf219
feat: Cookie에 JSESSIONID 값 저장하기 구현
takoyakimchi 9ecd573
refactor: 상수 사용하도록 일부 수정
takoyakimchi a86407a
fix: jakarta의 HttpSession을 사용하지 않도록 수정
takoyakimchi 239b42d
feat: 세션 구현
takoyakimchi d326ace
refactor: Request 관련 로직을 별도의 클래스로 분리
takoyakimchi c44ef38
refactor: 헤더 읽기, body 읽기 로직을 메서드로 분리
takoyakimchi 1310577
refactor: 쿠키 관련 로직을 분리
takoyakimchi 50f8f48
refactor: HTTP 응답 로직 분리
takoyakimchi 9c16499
refactor: 메서드명 및 시그니처명 변경
takoyakimchi 83023c1
refactor: inline variable 적용
takoyakimchi d931626
refactor: 핸들러 메서드 분리
takoyakimchi 875729e
refactor: 중복 제거
takoyakimchi c2d23de
refactor: 메서드명 변경
takoyakimchi af08606
refactor: 불필요한 if문 depth 제거
takoyakimchi 7fee36c
chore: 패키지 구조 변경
takoyakimchi fe6992b
refactor: set-cookie 하는 부분 메서드 분리
takoyakimchi ce21761
fix: Location 헤더로 올바르게 리다이렉션 하도록 수정
takoyakimchi 851ee85
refactor: 메서드명 수정
takoyakimchi db1cba5
fix: request line 마지막에 공백 추가
takoyakimchi 5735196
refactor: 단순 텍스트를 응답하는 경우에 대한 응답 메서드 작성
takoyakimchi 8fab15d
test: 깨지는 테스트 수정
takoyakimchi 74bdc40
refactor: 메서드명 변경
takoyakimchi a70c565
feat: 존재하지 않는 리소스에 접근하는 경우 404 페이지를 보여줌
takoyakimchi bb21902
refactor: Location 헤더를 enum으로 관리
takoyakimchi 436b85c
chore: print문 삭제
takoyakimchi af4c48a
refactor: Set-Cookie 헤더를 상수가 아닌 enum으로 변경
takoyakimchi 33af31d
test: FileTest 작성
takoyakimchi f69e93d
test: IOStreamTest 작성
takoyakimchi a321dd7
chore: 학습 테스트를 다시 버전관리 하도록 수정
takoyakimchi 9728731
fix: remove implementation logback-classic on gradle (#501)
geoje 6a3782a
fix: add threads min-spare configuration on properties (#502)
geoje 03b1b72
chore: Thymeleaf 의존성 추가
takoyakimchi df06a96
feat: 휴리스틱 캐싱 제거
takoyakimchi c0b08ee
chore: HTTP 압축 설정
takoyakimchi 2b3dcaf
feat: ETag 추가
takoyakimchi 69ec4d5
feat: .js와 .css 파일은 1년 동안 캐시 적용
takoyakimchi e3e1f40
refactor: interceptor 구현체를 지우고 WebContentIntercepor 사용
takoyakimchi 99ebc01
refactor: 헤더의 이름을 enum에서 꺼내오도록 수정
takoyakimchi f32bde8
refactor: 미사용 메서드 제거
takoyakimchi 2ec1366
refactor: depth 개선
takoyakimchi 65a1130
refactor: request에서 cookie 가져오는 로직 메서드로 분리
takoyakimchi f9b3f5b
refactor: HttpCookie에 세션 관련 메서드 생성
takoyakimchi f6848e4
refactor: Set-Cookie 관련 로직 개선
takoyakimchi 7511686
refactor: if문 개선
takoyakimchi 24a7655
refactor: HttpHeaders -> HttpHeaderType
takoyakimchi 4f1a76f
refactor: 반복문을 스트림으로 개선
takoyakimchi 45851e4
refactor: 각종 delimiters 상수화
takoyakimchi e5eac82
refactor: 중복되는 build() 로직 개선
takoyakimchi 6a2027b
refactor: CRLF 상수화
takoyakimchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
study/src/main/java/cache/com/example/cachecontrol/CacheWebConfig.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,13 +1,26 @@ | ||
| package cache.com.example.cachecontrol; | ||
|
|
||
| import static java.util.concurrent.TimeUnit.DAYS; | ||
|
|
||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.http.CacheControl; | ||
| import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
| import org.springframework.web.servlet.mvc.WebContentInterceptor; | ||
|
|
||
| @Configuration | ||
| public class CacheWebConfig implements WebMvcConfigurer { | ||
|
|
||
| @Override | ||
| public void addInterceptors(final InterceptorRegistry registry) { | ||
| WebContentInterceptor noCacheIntercepter = new WebContentInterceptor(); | ||
| noCacheIntercepter.addCacheMapping(CacheControl.noCache().cachePrivate(), "/**"); | ||
| registry.addInterceptor(noCacheIntercepter) | ||
| .excludePathPatterns("/**/*.js", "/**/*.css"); | ||
|
|
||
| WebContentInterceptor cacheIntercepter = new WebContentInterceptor(); | ||
| cacheIntercepter.addCacheMapping(CacheControl.maxAge(365, DAYS).cachePublic(), "/**"); | ||
| registry.addInterceptor(cacheIntercepter) | ||
| .addPathPatterns("/**/*.js", "/**/*.css"); | ||
| } | ||
| } | ||
14 changes: 10 additions & 4 deletions
14
study/src/main/java/cache/com/example/etag/EtagFilterConfiguration.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| package cache.com.example.etag; | ||
|
|
||
| import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.web.filter.ShallowEtagHeaderFilter; | ||
|
|
||
| @Configuration | ||
| public class EtagFilterConfiguration { | ||
|
|
||
| // @Bean | ||
| // public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() { | ||
| // return null; | ||
| // } | ||
| @Bean | ||
| public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilter() { | ||
| FilterRegistrationBean<ShallowEtagHeaderFilter> filter | ||
| = new FilterRegistrationBean<>(new ShallowEtagHeaderFilter()); | ||
| filter.addUrlPatterns("/etag", "*.js", "*.css"); | ||
| return filter; | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
21 changes: 21 additions & 0 deletions
21
tomcat/src/main/java/org/apache/catalina/session/Session.java
This file contains hidden or 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,21 @@ | ||
| package org.apache.catalina.session; | ||
|
|
||
| import com.techcourse.model.User; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| public class Session { | ||
|
|
||
| private static final String USER_SESSION_NAME = "user"; | ||
|
|
||
| private final Map<String, Object> values = new HashMap<>(); | ||
|
|
||
| private Session() { | ||
| } | ||
|
|
||
| public static Session ofUser(User user) { | ||
| Session session = new Session(); | ||
| session.values.put(USER_SESSION_NAME, user); | ||
| return session; | ||
|
Comment on lines
+16
to
+19
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 실제 사용하는 메서드만 남겨주셨군요 👍 |
||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미지 확장자는 처리하지 않은 이유가 있을까요 😃