Code Monkey home page Code Monkey logo

Comments (9)

kellyhutchins avatar kellyhutchins commented on July 24, 2024

@jgravois @afili can you look at this one?

from resource-proxy.

esoekianto avatar esoekianto commented on July 24, 2024

@jgravois @kellyhutchins

this is how java handles it,

public static boolean isUrlPrefixMatch(String prefix,String uri){
return uri.toLowerCase().startsWith(prefix.toLowerCase()) ||
uri.toLowerCase().replace("https://","http://").startsWith(prefix.toLowerCase()) ||
uri.toLowerCase().substring(uri.indexOf("//")).startsWith(prefix.toLowerCase());
}

then call isUrlPrefixMatch(su.getUrl(), uri) in getConfigServerUrl() function
we can just implement the same in .NET

from resource-proxy.

jgravois avatar jgravois commented on July 24, 2024

based on changes yesterday, whether or not 'http' or 'https' is specified in the proxy.config, a request to the resource using either protocol will be forwarded.

we don't appropriately handle if someone just uses '//server.com'.

it seems to me like it would make more sense for someone who wants to block requests with a particular protocol on a server to handle that in the server configuration itself (rather than via proxy security) so we might just leave the current behavior as is and document it. its definitely sufficient for the 1.0 release anyway.

from resource-proxy.

kellyhutchins avatar kellyhutchins commented on July 24, 2024

@jgravois I think the issue is that both php and java already support this so ideally we'd like it to work the same in .NET. Do you think its a common use case that someone would to block request w with a particular protocol? I haven't run into anyone asking for that functionality - but perhaps its come up before?

from resource-proxy.

jgravois avatar jgravois commented on July 24, 2024

i agree that consistency is king, but i have never heard of someone expecting/wanting the proxy to block the alternate protocol, only cases where they ran into trouble because both weren't allowed.

from resource-proxy.

bsvensson avatar bsvensson commented on July 24, 2024

@jgravois This comes in handy for some arcgisonline url's where it get switched from http to https automatically (and proxy would fail unless you set up both). It would be somewhat similar in principle to protocol relative URL as described in http://www.paulirish.com/2010/the-protocol-relative-url/

http://example.com - support http only
https://example.com - support https only
//example.com - support both http and https.

from resource-proxy.

jgravois avatar jgravois commented on July 24, 2024

my preference/opinion is that the current behavior of the .NET proxy (in which specifying either 'http' or 'https' in proxy.config allows users to proxy both protocols) is best because it doesn't require people to specify a protocol relative URL to avoid the kinds of problem Bjorn is referring to.

that being said, @afili and i are happy to rewrite the logic so that only specifying '//example.com' allows for proxying both. it shouldn't be hard.

from resource-proxy.

esoekianto avatar esoekianto commented on July 24, 2024

java is now following .NET, so if this really need to be addressed, we can come up with something

from resource-proxy.

jgravois avatar jgravois commented on July 24, 2024

merged .NET fix is 5421505 safe to close.

from resource-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.