Azure / Azure/static-web-apps-cli

Route rewrite removes Query Parameters

オープン
#930 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
668
フォーク
156
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

staticwebapp.config.json、`npx swa start public --api-location http://localhost:7071`、および `/something?key=value` へのリクエストを使って問題を再現し、`--verbose=silly` ログを有効にします。まず、CLI のルート書き換えと API 転送のエントリポイントから調査を開始し、API が元のクエリパラメーターを受け取ることを確認して、この動作のカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, typescript
領域
api, cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。