Commit e3a5f6b
authored
fix(cli): correct WebP MIME type check in handleResponse ('webp' → 'image/webp') (#1899)
## Summary
Fixes a bug in `src/daemon/client.ts` where the MIME type case for WebP
images was `'webp'` instead of the correct `'image/webp'`.
## Problem
In `handleResponse`, the switch statement for determining file extension
used the incorrect string `'webp'` as the MIME type. Since browsers and
servers send `image/webp` as the MIME type, the case never matched, and
all WebP images were saved with a `.png` extension instead of `.webp`.
```ts
// Before (buggy)
case 'webp':
extension = '.webp';
break;
// After (fixed)
case 'image/webp':
extension = '.webp';
break;
```
## Testing
WebP screenshots/images returned by the tool will now correctly receive
the `.webp` extension.
Closes #1898
Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>
Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>1 parent 0f29acf commit e3a5f6b
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
0 commit comments