diff --git a/xss-sanitize.cabal b/xss-sanitize.cabal
--- a/xss-sanitize.cabal
+++ b/xss-sanitize.cabal
@@ -1,5 +1,5 @@
 name:            xss-sanitize
-version:         0.3.5.2
+version:         0.3.5.3
 license:         BSD3
 license-file:    LICENSE
 author:          Greg Weber <greg@gregweber.info>
@@ -14,15 +14,22 @@
 homepage:        http://github.com/yesodweb/haskell-xss-sanitize
 extra-source-files: README.md
 
+flag network-uri
+  description: Get Network.URI from the network-uri package
+  default: True
+
 library
     build-depends:    base == 4.*, containers
                     , tagsoup     >= 0.12.2   && < 1
                     , utf8-string >= 0.3      && < 1
-                    , network     >= 2        && < 3
                     , css-text    >= 0.1.1    && < 0.2
                     , text        >= 0.11     && < 2
                     , attoparsec  >= 0.10.0.3 && < 1
 
+    if flag(network-uri)
+      build-depends: network-uri >= 2.6
+    else
+      build-depends: network < 2.6
 
     exposed-modules: Text.HTML.SanitizeXSS
     other-modules:   Text.HTML.SanitizeXSS.Css
@@ -35,12 +42,16 @@
     build-depends:    base == 4.* , containers
                     , tagsoup     >= 0.12.2   && < 1
                     , utf8-string >= 0.3      && < 1
-                    , network     >= 2        && < 3
                     , css-text    >= 0.1.1    && < 0.2
                     , text        >= 0.11     && < 2
                     , attoparsec  >= 0.10.0.3 && < 1
                     , hspec       >= 1.3
                     , HUnit       >= 1.2
+
+    if flag(network-uri)
+      build-depends: network-uri >= 2.6
+    else
+      build-depends: network < 2.6
 
 
 source-repository head
