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 net.minecraft.tileentity.TileEntity
import scala.collection.convert.WrapAsScala._ import scala.collection.convert.WrapAsScala._
import scala.language.implicitConversions import scala.language.implicitConversions
import java.nio.charset.MalformedInputException
class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard { class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
override val node = api.Network.newNode(this, Visibility.Network). override val node = api.Network.newNode(this, Visibility.Network).
@ -87,6 +88,8 @@ class WirelessNetworkCard(val owner: TileEntity) extends NetworkCard {
catch { catch {
case e: FileNotFoundException => case e: FileNotFoundException =>
context.signal("http_response", address, Unit, "not found: " + Option(e.getMessage).getOrElse(e.toString)) 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 => case e: Throwable =>
context.signal("http_response", address, Unit, Option(e.getMessage).getOrElse(e.toString)) 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 # blacklist is always applied, so if an entry is present in both the
# whitelist and the blacklist, the blacklist will win. # whitelist and the blacklist, the blacklist will win.
# All entries are regular expression patterns, but they will only be # All entries are regular expression patterns, but they will only be
# applied to the host name (domain) of a given URL. # applied to the host name (domain) of a given URL. Examples:
whitelist: [ # "^gist\\.github\\.com$", "^(:?www\\.)?pastebin\\.com$"
"^gist\\.github\\.com$" whitelist: []
"^(:?www\\.)?pastebin\\.com$"
]
} }
# Other settings that you might find useful to tweak. # Other settings that you might find useful to tweak.