Repository navigation
Conversation
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
lann
approved these changes
Nov 20, 2026
lann
left a comment
Contributor
There was a problem hiding this comment.
This seems like a good incremental improvement.
I think a better long-term solution would be to deliver the information via a new wit interface; maybe something like:
package spin:wasi-http;
interface request-extensions {
resource request-metadata {
client-addr: func() -> option<string>; // or whathaveyou
...
}
use wasi:http/types.{request};
get-request-metadata: func(request: borrow<request>) -> request-metadata;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spin uses headers like
spin-client-addrandspin-full-urlto provide information about the request. What should we do if a client - a sneaky, snaky client - sends those headers itself? At the moment we just shove everything into the headers, which think results in a multi-value header, which is not what an app would expect, and could lead to it misreading the (sneaky, snaky) client header values for the real Spin ones.This PR proposes renaming client-provided headers that clash with Spin-defined names.
An alternative would be to simply exterminate the client-provided headers for being sneaky and snaky, but I went for renaming so that apps have a workaround if they need to work with a client which is using these header names and does not want/is not able to change them.