Skip to content

Commit df2dcaa

Browse files
committed
fix(apigw): ignore case for api path
1 parent 0aca0af commit df2dcaa

File tree

1 file changed

+7
-3
lines changed
  • src/modules/apigw/entities

1 file changed

+7
-3
lines changed

src/modules/apigw/entities/api.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export default class ApiEntity {
275275
const [exist] = oldList.filter(
276276
(item) =>
277277
item?.method?.toLowerCase() === apiConfig?.method?.toLowerCase() &&
278-
item.path === apiConfig.path,
278+
item.path?.toLowerCase() === apiConfig.path?.toLowerCase(),
279279
);
280280

281281
if (exist) {
@@ -289,7 +289,7 @@ export default class ApiEntity {
289289
const [relativeApi] = apiList.filter(
290290
(item) =>
291291
item.method?.toLowerCase() === authRelationApi.method.toLowerCase() &&
292-
item.path === authRelationApi.path,
292+
item.path?.toLowerCase() === authRelationApi.path.toLowerCase(),
293293
);
294294
if (relativeApi) {
295295
apiConfig.authRelationApiId = relativeApi.apiId;
@@ -551,7 +551,11 @@ export default class ApiEntity {
551551

552552
if (ApiIdStatusSet) {
553553
ApiIdStatusSet.forEach((item) => {
554-
if (item.Path === path && item.Method.toLowerCase() === method.toLowerCase()) {
554+
// 比对 path+method 忽略大小写
555+
if (
556+
item.Path.toLowerCase() === path.toLowerCase() &&
557+
item.Method.toLowerCase() === method.toLowerCase()
558+
) {
555559
apiDetail = item;
556560
}
557561
});

0 commit comments

Comments
 (0)