report: accept a report ID that ends with a newline
Plain-text replies usually end with one, and the ID check counted it as part of the ID, so a report that was sent was said to have failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,8 @@ send() {
|
||||
code="${response##*$'\n'}"
|
||||
body="${response%$'\n'*}"
|
||||
[[ "$response" == *$'\n'* ]] || body="$response"
|
||||
# Without the newline that usually ends a reply
|
||||
body="${body%"${body##*[![:space:]]}"}"
|
||||
# A 2xx that isn't a report ID is some other page, not the receiver
|
||||
if (( status == 0 )) && [[ "$code" == 2?? && "$body" =~ ^[A-Za-z0-9-]{1,40}$ ]]; then
|
||||
echo "Sent. Thank you! Your report's ID is $body; mention it if you contact us about this."
|
||||
|
||||
Reference in New Issue
Block a user