The pathParse function in RescriptReactRouter.res currently treats single slash and double slash URLs identically, which causes routing conflicts and prevents proper URL differentiation.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu trong RescriptReactRouter.res, tại hàm pathParse, và kiểm tra logic split và filter đối với các đường dẫn được phân tách bằng dấu gạch chéo. Xác minh hành vi của /analytics-transaction và //analytics-transaction, sau đó xác nhận rằng các danh sách kết quả chỉ giữ lại phân đoạn rỗng ở đầu đối với URL có dấu gạch chéo kép.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Behavior
// Both URLs return the same parsed result
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"analytics-transaction"} // Problem!
Expected Behavior
// URLs should parse differently to enable proper routing
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"", "analytics-transaction"} // Should preserve leading empty string
Impact
- Cannot differentiate between /path and //path in routing logic
- Causes "Page Not Found" errors for valid double slash URLs
- Breaks routing patterns that rely on double slash prefixes
Proposed Solution
Modify the filter logic to preserve the first empty string while removing others:
// Current problematic code
raw->Js.String2.split("/")->Js.Array2.filter(item => item->Js.String2.length != 0)->arrayToList
// Proposed fix
let splitArray = raw->Js.String2.split("/")
let filteredArray = []
splitArray->Js.Array2.forEachi((item, index) => {
if item->Js.String2.length != 0 || index == 0 {
filteredArray->Js.Array2.push(item)->ignore
}
})
filteredArray->arrayToList
- Ngôn ngữ chính
- ReScript
- Star
- 517
- Fork
- 45
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rescript-lang/rescript-react
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
rescript-lang/rescript-react#152 · 3 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
rescript-lang/rescript-react#147 · 2 bình luận ·
-
ReScript-aware `memo` Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rescript-lang/rescript-react#111 · 3 bình luận ·
-
Implicit type conversion? Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
rescript-lang/rescript-react#105 ·
-
Scroll Restoration Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rescript-lang/rescript-react#104 · 1 reaction ·
Tất cả issue của rescript-lang/rescript-react
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jellyfin/jellyfin-web#8540 ·