Open
Conversation
這裡修正了以下問題:
1. `Attack` 結構體中的 `Debug` 字段現在會用來控制是否要記錄回應體。
2. `readBody` 方法現在會檢查讀取回應體時可能發生的錯誤。
3. 程式現在會處理攻擊運行時可能出現的 panic。
4. `PostJSON` 方法現在不會記錄請求體,以防止敏感資訊洩漏。
5. `PostJSON` 方法現在不會為每個攻擊創建新的 HTTP 客戶端。
6. `PostJSON` 方法現在會檢查發送請求或讀取回應時可能發生的錯誤。
7. 日誌格式字串不再使用 `%{color}` 指令。
8. 日誌格式字串現在只包含秒數,不再包含時區偏移量。
9. 日誌格式字串現在只包含秒數,不再包含微秒數。
10. `Post` 方法中的 `http.PostForm` 函數現在會正確地將請求體作為 `application/x-www-form-urlencoded` 發送。
11. `Post` 和 `PostJSON` 方法中的 `http.PostForm` 和 `http.Post` 函數現在會設置必要的 HTTP 標頭。
12. `PostJSON` 方法現在會設置 `User-Agent` 標頭。
13. `do` 方法現在會檢查 HTTP 回應的狀態碼,以確定請求是否成功。
14. `do` 方法現在會處理發送請求或讀取回應時可能發生的錯誤。
15. 日誌級別現在分為信息和錯誤兩種,更容易區分信息和錯誤訊息。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.