요청 본문 스트림은 한 번 읽으면 disturbed 가 되어 다시 읽을 수 없다. 누가 먼저 읽어 버렸는지 찾으려면 arrayBuffer·blob·formData·text·json 다섯 메서드를 Proxy 로 감싸, 불릴 때마다 console.trace 로 호출 스택을 찍고 원래 메서드를 그대로 부른다.

-- 요청 본문은 한 번만 읽힌다 (읽으면 disturbed). 누가 먼저 읽었나?
traced :: Name -> (a -> IO b) -> a -> IO b
traced name f x = trace ("Premature request." ++ name ++ " call!") >> f x   -- Proxy apply → Reflect.apply

wrap :: Request -> Request
wrap req = foldr (\m r -> set m (traced m (get m r)) r) req
                 ["arrayBuffer", "blob", "formData", "text", "json"]

출처

`#294`