-
Notifications
You must be signed in to change notification settings - Fork 1
Description
- Command parsing
Line 29 in 1251545
| [mode, endpoint, filePath, port] -> run (read mode) endpoint filePath (read port) |
Several notes:
-
I'd go for
optparse-applicativeinstead manual pattern matching. -
endpointargument is not used for replaying at all, confusing -
Pokemon exception handling?
Line 46 in 1251545
. Warp.setOnException (\ _ _ -> return ())
Maybe at least print exception to the console? -
Use 502 as default error handler (minor)
Line 51 in 1251545
defaultExceptionResponse e =
vcr-proxy/src/Network/VCR/Middleware.hs
Line 86 in 1251545
respond $ Wai.responseLBS HT.status500 -
Endpoint not stored in the casette
vcr-proxy/src/Network/VCR/Types.hs
Line 39 in 1251545
data Cassette = Cassette
I'd add it for future reference. -
UTF-8 handling
Not sure if this will be a problem in practice, but AFARI there is no standard that tells that urls have to be UTF-8 encoded. Perhaps we should operate on ByteStrings?
vcr-proxy/src/Network/VCR/Middleware.hs
Line 104 in 1251545
modifyPath = TE.encodeUtf8 . T.append scheme . T.append "://" . T.append (TE.decodeUtf8 host) . TE.decodeUtf8 -
Executable name
Line 48 in 1251545
vcr-proxy-exe:
Perhaps we could just call itvcr-proxy?