Azure / Azure/static-web-apps-cli
Route rewrite removes Query Parameters
- Ngôn ngữ chính
- TypeScript
- Star
- 668
- Fork
- 156
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).
**Are you accessing the CLI from the default port `:4280` ?**
- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [x] Yes, I am accessing the CLI from port `:4280`
> Make sure you are accessing the URL printed in the console when running `swa start`!
**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**
**Describe the bug**
When defining a route rewrite in the `staticwebapp.config.json` like this:
```
{
"routes": [
{
"route": "/something",
"rewrite": "/api/something"
}
}
```
The query parameters are not passed to the rewritten route.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a route as described above
2. In the API endpoint `something` log the query parameters from the request
3. Run `npx swa start public --api-location http://localhost:7071`
4. Request `http://localhost:4280/something?key=value`
5. Notice in API logs that no query parameters arrive
**Expected behavior**
The query parameters from the initial request are available in the API.
**Desktop (please complete the following information):**
- OS: Windows
- Version 11
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái hiện vấn đề bằng cách sử dụng staticwebapp.config.json, `npx swa start public --api-location http://localhost:7071` và yêu cầu tới `/something?key=value`; bật log `--verbose=silly`. Bắt đầu từ các điểm vào của CLI đối với việc viết lại route và chuyển tiếp API, sau đó xác minh rằng API nhận được tham số truy vấn ban đầu và bổ sung coverage cho hành vi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, typescript
- Lĩnh vực
- api, cli
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100