Revision 97:02fb4a7c2dcb java/jgsscli/src/jgsscli/httpmethods/HttpMethod.java

b/java/jgsscli/src/jgsscli/httpmethods/HttpMethod.java
150 150
	    httpMethod = new HttpMethod(method, requestDelete, uri, localPath);
151 151
	    break;
152 152
	}
153
	httpMethod.log.debug("uri=" + uri);
154 153
	return httpMethod;
155 154
    }
156 155

  
......
170 169
	    getInstance(method, methodContext.getURI(), 
171 170
		    methodContext.getLocalPath());
172 171
	request.fillRequestHeaders(methodContext.getDate(), 
173
		methodContext.getUserInfo());
172
		methodContext.getUserInfo(), methodContext.getRemotePath());
174 173
	return request;
175 174
    }
176 175

  
......
225 224
    /**
226 225
     * It fills in the headers required by the GSS API.
227 226
     * 
228
     * @param request
229
     *            The method request object.
230 227
     * @param timestamp
231 228
     *            The timestamp to be used for the request.
232 229
     * @param userInfo
233 230
     *            Object containing user details.
231
     * @param pathToSign
232
     *            The part of the URI to sign.      
234 233
     */
235
    private void fillRequestHeaders(Date timestamp, UserInfo userInfo) {
234
    private void fillRequestHeaders(Date timestamp, UserInfo userInfo,
235
	    String pathToSign) {
236 236
	log.debug("Request URI: " + this.uri);
237
	int pathStart = GSSUtils.SCHEME.length() + 3 // the "://" part
238
		+ GSSUtils.GSS_HOME.length() + GSSUtils.REST_PREFIX.length();
239
	String path = this.uri.substring(pathStart);
240
	log.debug("Path: " + path);
237
	log.debug("Path to sign: " + pathToSign);
241 238
	String strTimestamp = DATE_FORMATER.format(timestamp);
242 239
	String signature = sign(request.getMethod().toString(), strTimestamp,
243
		path, userInfo.getToken());
244
	this.request.addHeader(GSSUtils.AUTHORIZATION_HEADER, userInfo
245
		.getUsername()
246
		+ " " + signature);
240
		pathToSign, userInfo.getToken());
241
	this.request.addHeader(GSSUtils.AUTHORIZATION_HEADER, 
242
		userInfo.getUsername() + " " + signature);
247 243
	this.request.addHeader(GSSUtils.DATE_HEADER, strTimestamp);
248 244
    }
249 245

  

Also available in: Unified diff