Bug/fix double slashes #1045

Merged
merged 3 commits into from Dec 17, 2012

Projects

None yet

4 participants

@hdm
Contributor
hdm commented Nov 8, 2012

This is a replacement for PR #1004 (module fix vs general bandaid)

@ChrisJohnRiley
Contributor

I think you missed a few modules that could be affected by the //
issue (depending on user input)

Added a few to PULL 1047

#1047

@limhoff-r7
Contributor

I'm working on writing specs for normalize_uri. Wait for my commit before merging.

@limhoff-r7
Contributor

Can datastore['URI'] ever be nil when it gets to the call for normalize_uri or does the options validation prevent that? I aks because normalize_uri doesn't handle str being nil. If it can't handle str being nil, I'll document it as such.

@ChrisJohnRiley
Contributor

Surely it's easier to check if datastore['URI'] is empty or nil and if so
set it to '/' as the base. Just in case ;)
On 8 Nov 2012 19:47, "limhoff-r7" notifications@github.com wrote:

Can datastore['URI'] ever be nil when it gets to the call for
normalize_uri or does the options validation prevent that? I aks because
normalize_uri doesn't handle str being nil. If it can't handle str being
nil, I'll document it as such.


Reply to this email directly or view it on GitHubhttps://github.com/rapid7/metasploit-framework/pull/1045#issuecomment-10199731.

@hdm
Contributor
hdm commented Nov 8, 2012

It should probably handle nil (and default to /)

@limhoff-r7
Contributor

The to_s you call on str works on nil, so nil is cast to an empty string.

@todb-r7
Contributor
todb-r7 commented Dec 17, 2012

I kind of feel like this is a terrible thing to make people do:

  res = send_request_cgi({
  'uri'    => normalize_uri(datastore['URI']) + "/services/listServices",
  'method' => 'GET',

However, it's a symptom of the larger problem of datastore options not getting "normalized" in the usual sense anyway.

@todb-r7 todb-r7 merged commit 858cef8 into master Dec 17, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment