Skip to content

Commit

Permalink
fix url injection
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Nov 17, 2023
1 parent f1e4f88 commit 9ac3f92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datex_short.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function get<T=unknown>(dx:string|URL|Endpoint, assert_type?:Type<T
}

// escape urls
if (dx.toString().startsWith('http://') || dx.toString().startsWith('https://') || dx.toString().startsWith('file://') || dx.toString().startsWith('blob:http://') || dx.toString().startsWith('blob:https://')) dx = `url '${dx}'`;
if (dx.toString().startsWith('http://') || dx.toString().startsWith('https://') || dx.toString().startsWith('file://') || dx.toString().startsWith('blob:http://') || dx.toString().startsWith('blob:https://')) dx = `url "${dx}"`;

const res = <T> await _datex('get (' + dx + ' )', undefined, undefined, undefined, undefined, context_location, plugins);
if (plugins) activePlugins.splice(0, activePlugins.length);
Expand Down
2 changes: 1 addition & 1 deletion network/supranet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class Supranet {
public static sayHello(node:Endpoint = Runtime.main_node){
// TODO REPLACE, only temporary as placeholder to inform router about own public keys
const keys = Crypto.getOwnPublicKeysExported();
// console.warn("saying hello " + Runtime.endpoint)
logger.debug("saying hello as " + Runtime.endpoint)
Runtime.datexOut(['?', [keys], {type:ProtocolDataType.HELLO, sign:false, flood:true, __routing_ttl:10}], undefined, undefined, false, false)
// send with plain endpoint id as sender
// if (Runtime.endpoint.id_endpoint !== Runtime.endpoint) Runtime.datexOut(['?', [keys], {type:ProtocolDataType.HELLO, sign:false, flood:true, force_id:true, __routing_ttl:1}], undefined, undefined, false, false)
Expand Down

0 comments on commit 9ac3f92

Please sign in to comment.