Skip to content

feature[#318]: 특정 API에 처리율 제한 적용#319

Merged
rt3310 merged 4 commits intodevelopfrom
feature-318
Sep 17, 2025
Merged

feature[#318]: 특정 API에 처리율 제한 적용#319
rt3310 merged 4 commits intodevelopfrom
feature-318

Conversation

@rt3310
Copy link
Copy Markdown
Member

@rt3310 rt3310 commented Sep 12, 2025

이슈 번호 (#318)

요약

특정 API에 처리율 제한 적용

변경 내용

ApiThrottlingFilter 적용

@rt3310 rt3310 self-assigned this Sep 12, 2025
@rt3310 rt3310 added the feature 기능 관련 이슈 label Sep 12, 2025
@rt3310 rt3310 linked an issue Sep 12, 2025 that may be closed by this pull request
1 task
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment on lines +76 to +79
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setContentType("text/plain; charset=UTF-8");
httpResponse.setStatus(429);
response.getWriter().write(waitForRefill + "초 뒤에 다시 시도해주세요");
Copy link
Copy Markdown
Contributor

@soun997 soun997 Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래와 같이 ErrorResponse 사용해서 에러 응답 포맷을 통일하면 좋을 것 같아요~

	private void writeTooManyRequestsResponse(HttpServletResponse response, ErrorResponse body)
			throws IOException {
		response.setStatus(HttpStatus.TOO_MANY_REQUESTS.value());
		response.setContentType(MediaType.APPLICATION_JSON_VALUE);
		response.setCharacterEncoding(StandardCharsets.UTF_8.name());

		response.getWriter()
				.write(
						objectMapper.writeValueAsString(
								ResponseEntity.status(HttpStatus.TOO_MANY_REQUESTS.value()).body(body)));
		response.getWriter().flush();
	}

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rt3310 rt3310 merged commit 521ae73 into develop Sep 17, 2025
4 of 5 checks passed
@rt3310 rt3310 deleted the feature-318 branch September 17, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 기능 관련 이슈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 특정 API의 처리율 제한 적용

2 participants