PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: sindresorhus/got (ts)
Issue: Don't include a given request header when its value is null or undefined
If you do `got(url, { headers: { cookie: null } })`, the HTTP request has a header of `cookie: null` rather than not appearing at all. If you replace `null` with `undefined` then you get an error.

If a header is `null` or `undefined` the it shouldn't be added to the request headers.
Pull request description: Exclude passed headers with values `null` or `undefined`
**Notes:**
- Extract call to `lowercaseKeys` to leverage the object-safety it provides
- Delete headers with a value of `null` or `undefined`
- Considered exclusion of `''` as well, but this seems more common / legitimate from my research

Closes #410 


Patch:
diff --git a/index.js b/index.js
index 09ea52a..98123fb 100644
--- a/index.js
+++ b/index.js
@@ -458,10 +458,17 @@ function normalizeArguments(url, opts) {
 		opts
 	);
 
+	const headers = lowercaseKeys(opts.headers);
+	for (const key of Object.keys(headers)) {
+		if (headers[key] === null || headers[key] === undefined) {
+			delete headers[key];
+		}
+	}
+
 	opts.headers = Object.assign({
 		'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`,
 		'accept-encoding': 'gzip,deflate'
-	}, lowercaseKeys(opts.headers));
+	}, headers);
 
 	const query = opts.query;
 


Test patch:
diff --git a/test/headers.js b/test/headers.js
index 2a0a0ae..07fa774 100644
--- a/test/headers.js
+++ b/test/headers.js
@@ -89,6 +89,24 @@ test('form-data automatic content-type', async t => {
 	t.is(headers['content-type'], `multipart/form-data; boundary=${form.getBoundary()}`);
 });
 
+test('remove null value headers', async t => {
+	const headers = (await got(s.url, {
+		headers: {
+			unicorns: null
+		}
+	})).body;
+	t.false(Object.prototype.hasOwnProperty.call(headers, 'unicorns'));
+});
+
+test('remove undefined value headers', async t => {
+	const headers = (await got(s.url, {
+		headers: {
+			unicorns: undefined
+		}
+	})).body;
+	t.false(Object.prototype.hasOwnProperty.call(headers, 'unicorns'));
+});
+
 test.after('cleanup', async () => {
 	await s.close();
 });
Repository: tightenco/tlint (php)
Issue: Allow  $request->validate()
Pull request description: Fix RequestValidation lint triggering on injected request.
Closes #118 

Patch:
diff --git a/src/Linters/RequestValidation.php b/src/Linters/RequestValidation.php
index 9a97a01..464d08a 100644
--- a/src/Linters/RequestValidation.php
+++ b/src/Linters/RequestValidation.php
@@ -26,9 +26,8 @@ class RequestValidation extends BaseLinter
             if (! $isController && $this->extends($node, 'Controller')) {
                 $isController = true;
             }
-
             return $node instanceof Node\Expr\MethodCall
-                && ! $node->var instanceof Node\Expr\FuncCall
+                && $node->var->name === 'this'
                 && $node->name->name === 'validate';
         });
 


Test patch:
diff --git a/tests/Linting/Linters/RequestValidationTest.php b/tests/Linting/Linters/RequestValidationTest.php
index 5da9263..341823b 100644
--- a/tests/Linting/Linters/RequestValidationTest.php
+++ b/tests/Linting/Linters/RequestValidationTest.php
@@ -70,7 +70,7 @@ class ControllerA extends Controller
 {
     public function store(ARequest \$request)
     {
-        \$request()->validate(['name' => 'required']);
+        \$request->validate([]);
     }
 }
 file;