PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: tallarium/reverse_proxy_plug (elixir)

Issue:
Rewrite add_x_fwd_for_header
- IPV6 separators are `:`, not `.`
- Should use `List.key*` functions in general to be idiomatic

Pull request:
x-forwarded-for fixes
fixes #214 

Patch:
diff --git a/lib/reverse_proxy_plug.ex b/lib/reverse_proxy_plug.ex
index f978d00..389f39b 100644
--- a/lib/reverse_proxy_plug.ex
+++ b/lib/reverse_proxy_plug.ex
@@ -306,7 +306,7 @@ defmodule ReverseProxyPlug do
   defp add_x_fwd_for_header(headers, conn) do
     {x_fwd_for, headers} = Enum.split_with(headers, fn {k, _v} -> k == "x-forwarded-for" end)
 
-    remote_ip = conn.remote_ip |> Tuple.to_list() |> Enum.join(".")
+    remote_ip = conn.remote_ip |> :inet.ntoa() |> to_string()
 
     x_forwarded_for =
       case x_fwd_for do


Test patch:
diff --git a/test/reverse_proxy_plug_test.exs b/test/reverse_proxy_plug_test.exs
index 6a1c1f3..e448030 100644
--- a/test/reverse_proxy_plug_test.exs
+++ b/test/reverse_proxy_plug_test.exs
@@ -266,6 +266,24 @@ defmodule ReverseProxyPlugTest do
     assert_header(headers, "x-forwarded-for", ["127.0.0.2, 127.0.0.1"])
   end
 
+  test_stream_and_buffer "supports IPv6 addresses for x-forwarded-for header" do
+    %{req_function: req_function, opts: opts, get_responder: get_responder} = test_reuse_opts
+
+    ReverseProxyPlug.HTTPClientMock
+    |> expect(req_function, fn %{headers: headers} = request ->
+      send(self(), {:headers, headers})
+      get_responder.(%{}).(request)
+    end)
+
+    conn(:get, "/")
+    # ::1
+    |> Map.put(:remote_ip, {0, 0, 0, 0, 0, 0, 0, 1})
+    |> ReverseProxyPlug.call(ReverseProxyPlug.init(opts))
+
+    assert_receive {:headers, headers}
+    assert_header(headers, "x-forwarded-for", ["::1"])
+  end
+
   test_stream_and_buffer "removes hop-by-hop headers before forwarding request" do
     %{req_function: req_function, opts: opts, get_responder: get_responder} = test_reuse_opts
Repository: vuejs/composition-api (ts)

Issue:
Ref not unwrapping other refs set with `set` on Node
- Clone https://github.com/posva/bug-report-vca
- `yarn`
- `node index.js`

It should log an object `{ old: false, new: true }` but it logs `{ old: false, new: { value: true }}`

There is also an index.html file to show the (expected) behavior on a browser

Pull request:
feat(reactivity): unwrap value when using `set`
fix #721


When using `set` if the object is not `reactive` it won't execute the unwrapping as per expected on a reactive object, in vue 2 every object used is expected to be `reactive` by default so I believe is safe to assume that if you calling `set` we will want to unwrap the value if is a `ref`

Patch:
diff --git a/src/reactivity/set.ts b/src/reactivity/set.ts
index f2a733c..f33032d 100644
--- a/src/reactivity/set.ts
+++ b/src/reactivity/set.ts
@@ -34,7 +34,8 @@ export function set<T>(target: any, key: any, val: T): T {
     return val
   }
   if (!ob) {
-    target[key] = val
+    // If we are using `set` we can assume that the unwrapping is intended
+    defineAccessControl(target, key, val)
     return val
   }
   defineReactive(ob.value, key, val)


Test patch:
diff --git a/test/ssr/ssrReactive.spec.ts b/test/ssr/ssrReactive.spec.ts
index 5c8510c..b4325fa 100644
--- a/test/ssr/ssrReactive.spec.ts
+++ b/test/ssr/ssrReactive.spec.ts
@@ -90,4 +90,16 @@ describe('SSR Reactive', () => {
 
     done()
   })
+
+  // #721
+  it('should behave correctly', () => {
+    const state = ref({ old: ref(false) })
+    set(state.value, 'new', ref(true))
+    // console.log(process.server, 'state.value', JSON.stringify(state.value))
+
+    expect(state.value).toMatchObject({
+      old: false,
+      new: true,
+    })
+  })
 })