Created
April 27, 2017 07:38
-
-
Save jhrcek/b0dfddbe8880be565c04c39588e7dda3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
module Test where | |
import Data.Aeson | |
import Data.ByteString.Lazy (ByteString) | |
import Data.ByteString.Lazy.Char8 (pack) | |
import HAR.Entry | |
import Text.RawString.QQ (r) -- raw-strings-qq | |
main :: IO () | |
main = print (eitherDecode badTiming :: Either String Entry) | |
--Left "Error in $.timings: When parsing the record Timings of type HAR.Timings.Timings the key ssl was not present." | |
badTiming :: ByteString | |
badTiming = pack [r|{ | |
"pageref": "page_1", | |
"startedDateTime": "2017-04-26T15:54:27.044+02:00", | |
"time": 48, | |
"request": { | |
"bodySize": 115, | |
"method": "POST", | |
"url": "http://localhost:8080/business-central/j_security_check?locale=null", | |
"httpVersion": "HTTP/1.1", | |
"headers": [ | |
{ | |
"name": "Host", | |
"value": "localhost:8080" | |
}, | |
{ | |
"name": "User-Agent", | |
"value": "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" | |
}, | |
{ | |
"name": "Accept", | |
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" | |
}, | |
{ | |
"name": "Accept-Language", | |
"value": "en-US,en;q=0.5" | |
}, | |
{ | |
"name": "Accept-Encoding", | |
"value": "gzip, deflate" | |
}, | |
{ | |
"name": "Referer", | |
"value": "http://localhost:8080/business-central/kie-wb.jsp" | |
}, | |
{ | |
"name": "Cookie", | |
"value": "JSESSIONID=FQo6W9JxH9n_HCiu8Ykmu3silsHQ3bQdIYmzL5zw.pc" | |
}, | |
{ | |
"name": "Connection", | |
"value": "keep-alive" | |
} | |
], | |
"cookies": [ | |
{ | |
"name": "JSESSIONID", | |
"value": "FQo6W9JxH9n_HCiu8Ykmu3silsHQ3bQdIYmzL5zw.pc" | |
} | |
], | |
"queryString": [ | |
{ | |
"name": "locale", | |
"value": "null" | |
} | |
], | |
"postData": { | |
"mimeType": "application/x-www-form-urlencoded", | |
"params": [ | |
{ | |
"name": "j_username", | |
"value": "testadmin" | |
}, | |
{ | |
"name": "j_password", | |
"value": "admin1234;" | |
} | |
], | |
"text": "Content-Type: application/x-www-form-urlencoded\r\nContent-Length: 44\r\n\r\nj_username=testadmin&j_password=admin1234%3B" | |
}, | |
"headersSize": 452 | |
}, | |
"response": { | |
"status": 302, | |
"statusText": "Found", | |
"httpVersion": "HTTP/1.1", | |
"headers": [ | |
{ | |
"name": "Expires", | |
"value": "0" | |
}, | |
{ | |
"name": "Cache-Control", | |
"value": "no-cache, no-store, must-revalidate" | |
}, | |
{ | |
"name": "X-Powered-By", | |
"value": "Undertow/1" | |
}, | |
{ | |
"name": "Set-Cookie", | |
"value": "JSESSIONID=AmaINrFr9HHXdk0Z-pwIIr3w06tz7aUhFmrsL04W.pc; path=/business-central; HttpOnly\nJSESSIONIDSSO=MMGRuUqmDk6pMQ5NYwq96T_CsK4aGHXcljX2G5se; path=/" | |
}, | |
{ | |
"name": "Server", | |
"value": "JBoss-EAP/7" | |
}, | |
{ | |
"name": "Pragma", | |
"value": "no-cache" | |
}, | |
{ | |
"name": "Location", | |
"value": "http://localhost:8080/business-central/kie-wb.jsp" | |
}, | |
{ | |
"name": "Date", | |
"value": "Wed, 26 Apr 2017 13:54:27 GMT" | |
}, | |
{ | |
"name": "Connection", | |
"value": "keep-alive" | |
}, | |
{ | |
"name": "Content-Length", | |
"value": "0" | |
} | |
], | |
"cookies": [ | |
{ | |
"name": "JSESSIONID", | |
"value": "AmaINrFr9HHXdk0Z-pwIIr3w06tz7aUhFmrsL04W.pc" | |
}, | |
{ | |
"name": "JSESSIONIDSSO", | |
"value": "MMGRuUqmDk6pMQ5NYwq96T_CsK4aGHXcljX2G5se" | |
} | |
], | |
"content": { | |
"mimeType": "text/html; charset=UTF-8", | |
"size": 0, | |
"comment": "Response bodies are not included." | |
}, | |
"redirectURL": "http://localhost:8080/business-central/kie-wb.jsp", | |
"headersSize": 457, | |
"bodySize": 3796 | |
}, | |
"cache": {}, | |
"timings": { | |
"blocked": 0, | |
"dns": 0, | |
"connect": 0, | |
"send": 0, | |
"wait": 48, | |
"receive": 0 | |
}, | |
"serverIPAddress": "127.0.0.1", | |
"connection": "8080" | |
}|] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment