moved example whitelist entries to comment so we default to using the blacklist as suggested in #19; better message when http api fails parsing binary data (see #21)

This commit is contained in:
Florian Nücke 2013-12-24 12:58:47 +01:00
parent 28c504d342
commit 22bcc5756e
2 changed files with 6 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import net.minecraft.server.MinecraftServer
import net.minecraft.tileentity.TileEntity
import scala.collection.convert.WrapAsScala._
import scala.language.implicitConversions
import java.nio.charset.MalformedInputException
class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
override val node = api.Network.newNode(this, Visibility.Network).
@ -87,6 +88,8 @@ class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
catch {
case e: FileNotFoundException =>
context.signal("http_response", address, Unit, "not found: " + Option(e.getMessage).getOrElse(e.toString))
case _: MalformedInputException =>
context.signal("http_response", address, Unit, "binary data not yet supported")
case e: Throwable =>
context.signal("http_response", address, Unit, Option(e.getMessage).getOrElse(e.toString))
}

View File

@ -573,11 +573,9 @@ opencomputers {
# blacklist is always applied, so if an entry is present in both the
# whitelist and the blacklist, the blacklist will win.
# All entries are regular expression patterns, but they will only be
# applied to the host name (domain) of a given URL.
whitelist: [
"^gist\\.github\\.com$"
"^(:?www\\.)?pastebin\\.com$"
]
# applied to the host name (domain) of a given URL. Examples:
# "^gist\\.github\\.com$", "^(:?www\\.)?pastebin\\.com$"
whitelist: []
}
# Other settings that you might find useful to tweak.