swift-server / swift-server/async-http-client

Add tests for cross-origin headers

Open
#357 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

I noticed that I was able to replace the same-origin check in HTTPHandler with if true and if false and still pass all of the tests.

https://github.com/swift-server/async-http-client/blob/f3521033efcf02027367197986afbbf6808a1ed8/Sources/AsyncHTTPClient/HTTPHandler.swift#L1241

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Sources/AsyncHTTPClient/HTTPHandler.swift around line 1241 and inspect the same-origin check and its cross-origin header handling. Add tests that exercise both outcomes and ensure they fail when the check is replaced with either if true or if false; run the relevant test suite to verify the coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.