Skip to content

Conversation

@alexlamsl
Copy link
Contributor

fixes #1668

expect(await response.text()).toBe("such fail");
}
expect(response.status).toBe(500);
expect(await response.text()).toBe("PASS");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test fails to begin with − so I just fix up the expected results based on description, which remains to fail but at least it's a good starting point.

while (true) {
try {
serverOptions.port = port++;
server = serve(serverOptions);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could use server.reload here and then an afterAll to terminate the server at the very end

var response: *JSC.WebCore.Response = this.response_ptr.?;
var status = response.statusCode();
var needs_content_range = this.needs_content_range;
var needs_content_range = this.needs_content_range and this.sendfile.remain < this.blob.size();
Copy link
Collaborator

Choose a reason for hiding this comment

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

sendfile is initialized to undefined, so we need to be extremely careful when it is accessed

I think this is okay because needs_content_range is initialized to false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The next line does:

const size = if (needs_content_range)
    this.sendfile.remain
else
    this.blob.size();

Hence I won't be introducing any new NPE here 😏

@Jarred-Sumner Jarred-Sumner merged commit f78f423 into oven-sh:main Dec 28, 2022
@alexlamsl alexlamsl deleted the issue-1668 branch December 28, 2022 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forced 206 Partial Content in response

2 participants