Implement Response::see_other/redirect/temporary_redirect - #107
Open
harmony7 wants to merge 1 commit into
Open
Conversation
These three static constructors were declared in `include/fastly/http/response.h`
(lines 142, 154, 166) and had working Rust wrappers and cxx bridge declarations
(`src/http/response.rs`, `src/lib.rs`), but were never defined in the public C++
layer. Because a declaration without a definition is legal C++ and nothing in the
repo called them, the whole build and test suite passed with the gap in place;
any user calling one got an `undefined symbol` link error instead of a compile
error:
wasm-ld: error: undefined symbol:
fastly::http::Response::redirect(std::string_view)
The three definitions mirror the existing `Response::from_status`, passing the
destination across the bridge with `static_cast<std::string>` per the bridge's
string convention.
Adds test/response_redirect.cpp asserting the `Location` header for each, plus a
non-null-terminated `string_view` case to cover the conversion. The status codes
these set (303/308/307) are not asserted because `Response::get_status()` does
not exist on this branch; those assertions belong with the get_status work.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
These three static constructors were declared in
include/fastly/http/response.h(lines 142, 154, 166) and had working Rust wrappers and cxx bridge declarations (src/http/response.rs,src/lib.rs), but were never defined in the public C++ layer.Because a declaration without a definition is legal C++ and nothing in the repo called them, the whole build and test suite passed with the gap in place; any user calling one got an
undefined symbollink error instead of a compile error: