elm-pages 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/adapter/netlify.js
CHANGED
|
@@ -159,10 +159,11 @@ async function render(event, context) {
|
|
|
159
159
|
*/
|
|
160
160
|
function reqToJson(req) {
|
|
161
161
|
return {
|
|
162
|
+
requestTime: Math.round(new Date().getTime()),
|
|
162
163
|
method: req.httpMethod,
|
|
163
164
|
headers: req.headers,
|
|
164
165
|
rawUrl: req.rawUrl,
|
|
165
|
-
body: req.body,
|
|
166
|
+
body: req.body || null,
|
|
166
167
|
multiPartFormData: null,
|
|
167
168
|
};
|
|
168
169
|
}
|
package/package.json
CHANGED
package/src/Internal/Request.elm
CHANGED
|
@@ -41,19 +41,15 @@ fakeRequest =
|
|
|
41
41
|
|
|
42
42
|
requestDecoder : Decode.Decoder RequestRecord
|
|
43
43
|
requestDecoder =
|
|
44
|
-
Decode.
|
|
45
|
-
|
|
46
|
-
(Decode.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|>
|
|
52
|
-
|
|
53
|
-
|> Decode.field "rawUrl"
|
|
54
|
-
)
|
|
55
|
-
|> andMap (Decode.field "headers" (Decode.dict Decode.string))
|
|
56
|
-
|> andMap
|
|
44
|
+
Decode.map6 RequestRecord
|
|
45
|
+
(Decode.field "requestTime"
|
|
46
|
+
(Decode.int |> Decode.map Time.millisToPosix)
|
|
47
|
+
)
|
|
48
|
+
(Decode.field "method" Decode.string)
|
|
49
|
+
(Decode.maybe (Decode.field "body" Decode.string))
|
|
50
|
+
(Decode.field "rawUrl" Decode.string)
|
|
51
|
+
(Decode.maybe (Decode.field "headers" (Decode.dict Decode.string)) |> Decode.map (Maybe.withDefault Dict.empty))
|
|
52
|
+
(Decode.maybe
|
|
57
53
|
(Decode.field "headers"
|
|
58
54
|
(optionalField "cookie" Decode.string
|
|
59
55
|
|> Decode.map
|
|
@@ -62,6 +58,8 @@ requestDecoder =
|
|
|
62
58
|
)
|
|
63
59
|
)
|
|
64
60
|
)
|
|
61
|
+
|> Decode.map (Maybe.withDefault Dict.empty)
|
|
62
|
+
)
|
|
65
63
|
|
|
66
64
|
|
|
67
65
|
andMap : Decode.Decoder a -> Decode.Decoder (a -> b) -> Decode.Decoder b
|