Ptt-official-app / Ptt-backend

PTT APP 的後端
BSD 3-Clause "New" or "Revised" License
208 stars 68 forks source link

增加判斷如果為空就不往下執行,並回傳錯誤訊息 #214

Closed y2468101216 closed 3 years ago

y2468101216 commented 3 years ago

👏 解決掉的 issue / Resolved Issues

⛏ 變更內容 / Details of Changes

修正無參數時不執行下面的檢驗

y2468101216 commented 3 years ago

我在想是不是直接先判斷有沒有帶 header - x-www-form-urlencoded 比較好

PichuChen commented 3 years ago

@y2468101216 可以幫我把測試結果截圖傳上來嗎?

y2468101216 commented 3 years ago

螢幕擷取畫面 2021-06-08 095311

PichuChen commented 3 years ago

他回應的 error_description 感覺未來需要再討論

PichuChen commented 3 years ago

目前測試

crul 'localhost:8081/v1/token' -d 'username=guest' -d 'password='

他會回傳

{
  "error": "grant_error",
  "error_description": "empty password"
}

不過應該算是有解決問題了。