Skip to content
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

Add fields.has to query if a header is present in a fields #7625

Merged

Conversation

elliottt
Copy link
Member

@elliottt elliottt commented Dec 2, 2023

As discussed in WebAssembly/wasi-http#82, it would be nice to be able to know when a header value exists, vs when it's empty.

@elliottt elliottt requested a review from a team as a code owner December 2, 2023 00:22
@elliottt elliottt requested review from alexcrichton and pchickey and removed request for a team December 2, 2023 00:22
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Dec 2, 2023
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, but @pchickey should sign-off on this as well

@alexcrichton
Copy link
Member

Also, should this also be sent upstream to WebAssembly/wasi-http?

@elliottt
Copy link
Member Author

elliottt commented Dec 4, 2023

Also, should this also be sent upstream to WebAssembly/wasi-http?

Yes, I'll make that pr as well. Thanks!

@elliottt
Copy link
Member Author

elliottt commented Dec 4, 2023

Upstream pr: WebAssembly/wasi-http#91

@elliottt elliottt changed the title Make fields.get return an option Add fields.has to query if a header is present in a fields Dec 5, 2023
@@ -322,14 +330,14 @@ interface types {

/// Set the timeout for the initial connect to the HTTP Server. An error
/// return value indicates that this timeout is not supported.
set-connect-timeout: func(duration: option<duration>) -> result;
set-connect-timeout: func(ms: option<duration>) -> result;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not pull these ms names from upstream and instead fix those upstream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, thanks for catching this!

@elliottt elliottt added this pull request to the merge queue Dec 5, 2023
Merged via the queue into bytecodealliance:main with commit 11586fb Dec 5, 2023
19 checks passed
@elliottt elliottt deleted the trevor/wasi-http-fields-get branch December 5, 2023 08:00
elliottt added a commit to elliottt/wasmtime that referenced this pull request Dec 6, 2023
…odealliance#7625)

* Make `fields.get` return an option

* Add `fields.has`

* Sync with the upstream wasi-http types.wit

* Revert changes to rename duration to ms
alexcrichton pushed a commit that referenced this pull request Dec 6, 2023
#7641)

* Make `fields.get` return an option

* Add `fields.has`

* Sync with the upstream wasi-http types.wit

* Revert changes to rename duration to ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants