Skip to content

assistant_slash_commands: Be more precise in content type matching #29124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

evaporei
Copy link
Contributor

While investigating #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:

$ 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

This comment was marked as resolved.

@evaporei

This comment was marked as resolved.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 20, 2025

This comment was marked as resolved.

@maxdeviant maxdeviant changed the title assistant_slash_commands: be more precise in content type matching assistant_slash_commands: Be more precise in content type matching Apr 20, 2025
@evaporei evaporei force-pushed the assistant-slash-commands/content-type-fix branch from 9336a04 to 2a5fa48 Compare April 20, 2025 14:12
@zed-industries-bot
Copy link

zed-industries-bot commented Apr 25, 2025

Messages
📖

This PR includes links to the following GitHub Issues: #28076
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against cc20f44

@notpeter notpeter self-assigned this May 5, 2025
@notpeter notpeter enabled auto-merge (squash) May 5, 2025 22:49
@notpeter
Copy link
Member

notpeter commented May 5, 2025

Thanks!

@notpeter notpeter merged commit 55fd835 into zed-industries:main May 6, 2025
19 checks passed
JosephTLyons pushed a commit that referenced this pull request May 6, 2025
…29124)

While investigating #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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants