New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using http://name:pass@host:port is broken when uploading a model to /system/model #9

Closed
rantav opened this Issue Dec 26, 2010 · 3 comments

Comments

Projects
None yet
2 participants
@rantav
Contributor

rantav commented Dec 26, 2010

I'm trying to upload a model file through the rest API using a modelUrl parameter.

The following call fails with

The request sent by the client was syntactically incorrect (Server returned HTTP response code: 401 for URL: http://user:pass@svn.../.../glu.json

curl  -d "modelUrl=http://user:pass@svn.../.../glu.json" http://glua:password@tush:8080/console/rest/v1/glu-dev-1/system/model

While this call actually passes:

curl -d "modelUrl=file:/outbrain/glu/glu.json" http://glua:password@tush:8080/console/rest/v1/glu-dev-1/system/model

I think that the problem is similar to the one described at https://github.com/linkedin/glu/issues/closed#issue/8 only that this time I wasn't able to find the source code for the class that actually makes the HTTP request.

The line is ModelController.groovy:117

model = GroovyNetUtils.toURI(params.modelUrl).toURL().text

the .text I assume should fetch the content of params.modelUrl but it fails for the given http parameter and my assumption is that its authentication isn't performed correctly (if I try a URL without user:pass then it's OK).

@rantav

This comment has been minimized.

Contributor

rantav commented Dec 26, 2010

I think GroovyNetUtils is inaccessible, not part of the project

@ypujante

This comment has been minimized.

Member

ypujante commented Dec 26, 2010

GroovyNetUtils is in the linkedin-utils open source project but has nothing to do with the problem. The method being used here is [URL.getText()](http://groovy.codehaus.org/groovy-jdk/java/net/URL.html#getText(\)) which is a standard method added by groovy. Clearly the implementation of this method is not handling basic authentication properly.

I think I will need to refactor the code to extract the logic of fetching a url in a common place and share it between ShellImpl and this code.

Yan

@ypujante

This comment has been minimized.

Member

ypujante commented Jan 18, 2011

Fixed with 1.7.0

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment