Browse Source

accept missing to header from server

Interoperability Note: It is possible that implementations based on
[RFC3920] will not include the 'to' address on stream headers; an entity
SHOULD be liberal in accepting such stream headers.
master
Jon Kristensen 14 years ago
parent
commit
f9324a0c72
  1. 2
      source/Network/Xmpp/Stream.hs

2
source/Network/Xmpp/Stream.hs

@ -122,7 +122,7 @@ xmppStream expectedTo = do
validateData (_, _, _, _, Nothing) = throwError $ StreamWrongLangTag Nothing validateData (_, _, _, _, Nothing) = throwError $ StreamWrongLangTag Nothing
validateData (ver, from, to, i, Just lang) validateData (ver, from, to, i, Just lang)
| ver /= "1.0" = throwError $ StreamWrongVersion (Just ver) | ver /= "1.0" = throwError $ StreamWrongVersion (Just ver)
| to /= expectedTo = throwError $ StreamWrongTo (Text.pack . show <$> to) | isJust to && to /= expectedTo = throwError $ StreamWrongTo (Text.pack . show <$> to)
-- | lang /= expectedLang = throwError $ StreamWrongLangTag lang -- | lang /= expectedLang = throwError $ StreamWrongLangTag lang
| otherwise = return (from, to, i, lang) | otherwise = return (from, to, i, lang)
xmppStreamFeatures :: StreamSink ServerFeatures xmppStreamFeatures :: StreamSink ServerFeatures

Loading…
Cancel
Save