ZIm/crates/assistant_slash_commands
Eva Pace 55fd8352e4
assistant_slash_commands: Be more precise in content type matching (#29124)
While investigating https://github.com/zed-industries/zed/issues/28076,
I found out often times the content type header of a website comes with
more data, such as the `charset`. So instead of doing an equal
comparison, I changed to a `starts_with`.

You can see an example here:

```shell
$ curl -sS -D - https://github.com/zed-industries/zed/blob/main/Cargo.toml -o /dev/null | head -n 10
HTTP/2 200
date: Sun, 20 Apr 2025 10:19:52 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame,Accept-Encoding, Accept, X-Requested-With
etag: W/"92dabf048b34d04a1b1d94e29cae4aca"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
```

Release Notes:

- Improved Content Type matching of `/fetch` commands in Assistant

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-05-06 04:38:03 +00:00
..
src assistant_slash_commands: Be more precise in content type matching (#29124) 2025-05-06 04:38:03 +00:00
Cargo.toml Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
LICENSE-GPL Extract slash commands to their own crate (#23261) 2025-01-16 22:17:07 +00:00