mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
changing the acceptable url format for the http modem to drop the double slashes after the 'http' or somethingas the they get replaced into single one on command.js but not on the user program, producing discrepancy
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
let url="http://localhost/testnet/test.txt"
|
||||
let url="http:localhost/testnet/test.txt"
|
||||
|
||||
let file = files.open("B:\\"+url)
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ import java.net.URL
|
||||
|
||||
|
||||
/**
|
||||
* To get a text from the web address, send message: `GET https:en.wikipedia.org/wiki/Http`
|
||||
*
|
||||
* Note that there is no double-slash after the protocol (or scheme)
|
||||
*
|
||||
* Created by minjaesong on 2022-09-22.
|
||||
*/
|
||||
class HttpModem(private val vm: VM) : BlockTransferInterface(false, true) {
|
||||
@@ -115,6 +119,8 @@ class HttpModem(private val vm: VM) : BlockTransferInterface(false, true) {
|
||||
printdbg("msg: $inputString, lastIndex: ${inputString.lastIndex}")
|
||||
|
||||
cnxUrl = inputString.substring(4).filter { it in '!'..'~' }
|
||||
val protocolSep = cnxUrl!!.indexOf(':')
|
||||
cnxUrl = cnxUrl!!.substring(0, protocolSep) + "://" + cnxUrl!!.substring(protocolSep + 1)
|
||||
|
||||
printdbg("URL: $cnxUrl")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user