fix: X-Service-Code 미들웨어 경로 제외 수정 (#59)'
All checks were successful
SPMS_API/pipeline/head This commit looks good
All checks were successful
SPMS_API/pipeline/head This commit looks good
Reviewed-on: https://git.ipstein.myds.me/SPMS/SPMS_API/pulls/60
This commit is contained in:
commit
179e5897bf
|
|
@ -15,8 +15,12 @@ public class SpmsHeaderOperationFilter : IOperationFilter
|
|||
|
||||
operation.Parameters ??= new List<OpenApiParameter>();
|
||||
|
||||
// /v1/in/* 내부 API는 X-Service-Code 필요
|
||||
if (relativePath.StartsWith("v1/in"))
|
||||
// v1/in/* 중 X-Service-Code가 필요한 경로만 (device, message, push, stats, file)
|
||||
if (relativePath.StartsWith("v1/in/device") ||
|
||||
relativePath.StartsWith("v1/in/message") ||
|
||||
relativePath.StartsWith("v1/in/push") ||
|
||||
relativePath.StartsWith("v1/in/stats") ||
|
||||
relativePath.StartsWith("v1/in/file"))
|
||||
{
|
||||
operation.Parameters.Add(new OpenApiParameter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ public class ServiceCodeMiddleware
|
|||
public async Task InvokeAsync(HttpContext context, IServiceRepository serviceRepository)
|
||||
{
|
||||
if (context.Request.Path.StartsWithSegments("/v1/out") ||
|
||||
context.Request.Path.StartsWithSegments("/v1/in/auth") ||
|
||||
context.Request.Path.StartsWithSegments("/v1/in/account") ||
|
||||
context.Request.Path.StartsWithSegments("/v1/in/public") ||
|
||||
context.Request.Path.StartsWithSegments("/v1/in/service") ||
|
||||
context.Request.Path.StartsWithSegments("/swagger") ||
|
||||
context.Request.Path.StartsWithSegments("/health"))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user