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

Fix HTTP spec issues by upgrading uWS version #14853

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Oct 27, 2024

What does this PR do?

Fixes #14826
Fixes #6583

Before:

✅ Valid POST request with body: Response Status Code 200, Expected ranges: [[200,299],[404,404]]
✅ Empty header value: Response Status Code 200, Expected ranges: [[200,299]]
✅ Valid GET request with edge cases: Response Status Code 200, Expected ranges: [[200,299]]
✅ Valid GET request: Response Status Code 200, Expected ranges: [[200,299]]
✅ Request with Expect header: Response Status Code 100, Expected ranges: [[100,100],[200,299]]
❌ Conflicting Transfer-Encoding and Content-Length: Read operation timed out
❌ Invalid line ending: Read operation timed out
❌ Invalid prefix of request: Read operation timed out
❌ Invalid HTTP version: Read operation timed out
❌ Header containing invalid control character: Read operation timed out
❌ Non-numeric Content-Length header: Read operation timed out
❌ Negative Content-Length header: Read operation timed out
❌ Overflowing negative Content-Length header: Read operation timed out
❌ Missing Host header: Read operation timed out
❌ Invalid header characters: Read operation timed out
❌ Request without HTTP version: Read operation timed out
✅ Fragmented request termination: Server waited successfully
✅ Fragmented request: Server waited successfully
✅ Fragmented field value 4: Server waited successfully
✅ Fragmented field value 3: Server waited successfully
✅ Fragmented field value 2: Server waited successfully
✅ Fragmented field value 1: Server waited successfully
✅ Fragmented field name: Server waited successfully
✅ Fragmented request line newline 2: Server waited successfully
✅ Fragmented request line newline 1: Server waited successfully
✅ Fragmented request line: Server waited successfully
✅ Fragmented HTTP version: Server waited successfully
✅ Fragmented URL 3: Server waited successfully
✅ Fragmented URL 2: Server waited successfully
✅ Fragmented URL 1: Server waited successfully
✅ Fragmented method: Server waited successfully

20 out of 31 tests passed.

After:

✅ Conflicting Transfer-Encoding and Content-Length: Response Status Code 400, Expected ranges: [[400,499]]
✅ Valid POST request with body: Response Status Code 200, Expected ranges: [[200,299],[404,404]]
✅ Invalid line ending: Response Status Code 400, Expected ranges: [[400,499]]
✅ Invalid prefix of request: Response Status Code 505, Expected ranges: [[400,499],[500,599]]
✅ Invalid HTTP version: Response Status Code 505, Expected ranges: [[400,499],[500,599]]
✅ Header containing invalid control character: Response Status Code 400, Expected ranges: [[400,499]]
✅ Empty header value: Response Status Code 200, Expected ranges: [[200,299]]
✅ Non-numeric Content-Length header: Response Status Code 400, Expected ranges: [[400,499]]
✅ Negative Content-Length header: Response Status Code 400, Expected ranges: [[400,499]]
✅ Overflowing negative Content-Length header: Response Status Code 400, Expected ranges: [[400,499]]
✅ Missing Host header: Response Status Code 400, Expected ranges: [[400,499]]
✅ Invalid header characters: Response Status Code 400, Expected ranges: [[400,499]]
✅ Valid GET request with edge cases: Response Status Code 200, Expected ranges: [[200,299]]
✅ Valid GET request: Response Status Code 200, Expected ranges: [[200,299]]
✅ Request with Expect header: Response Status Code 100, Expected ranges: [[100,100],[200,299]]
✅ Request without HTTP version: Response Status Code 505, Expected ranges: [[400,599]]
✅ Fragmented request termination: Server waited successfully
✅ Fragmented request: Server waited successfully
✅ Fragmented field value 4: Server waited successfully
✅ Fragmented field value 3: Server waited successfully
✅ Fragmented field value 2: Server waited successfully
✅ Fragmented field value 1: Server waited successfully
✅ Fragmented field name: Server waited successfully
✅ Fragmented request line newline 2: Server waited successfully
✅ Fragmented request line newline 1: Server waited successfully
✅ Fragmented request line: Server waited successfully
✅ Fragmented HTTP version: Server waited successfully
✅ Fragmented URL 3: Server waited successfully
✅ Fragmented URL 2: Server waited successfully
✅ Fragmented URL 1: Server waited successfully
✅ Fragmented method: Server waited successfully

How did you verify your code works?

Tests copied from https://github.com/uNetworking/h1spec/blob/main/http_test.ts

@robobun
Copy link

robobun commented Oct 27, 2024

@Jarred-Sumner, your commit 418838e has 8 failures in #5350:

  • test/cli/run/require-cache.test.ts - 1 failing on 🪟 x64
  • test/js/web/fetch/fetch-leak.test.ts - 1 failing on 🪟 x64-baseline
  • test/js/web/fetch/fetch.tls.test.ts - 1 failing on 🍎 aarch64
  • test/js/bun/spawn/spawn.test.ts - timeout on 🪟 x64
  • test/js/web/timers/setInterval.test.js - 1 failing on 🪟 x64
  • test/package.json - timeout on 🪟 x64-baseline
  • test/cli/install/registry/bun-install-registry.test.ts - 1 failing on 🍎 x64
  • test/cli/install/bun-install.test.ts - 2 failing on 🍎 aarch64
  • test/cli/install/bun-install.test.ts - 1 failing on 🍎 aarch64
  • test/cli/install/bun-install.test.ts - 1 failing on 🍎 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🍎 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🪟 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64-baseline
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64-baseline
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64-baseline
  • test/cli/install/bun-install.test.ts - 1 failing on 🪟 x64-baseline
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 x64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 aarch64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 aarch64
  • test/cli/install/bun-install.test.ts - 1 failing on 🐧 aarch64
  • test/cli/install/bun-install.test.ts - 1 failing on 🪟 x64
  • 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.

    HTTP spec issues Bun will not close socket if receive not understandable request in Bun.serve
    2 participants