Is there a clean-URL-reflective version of file_create_url()? I have a site with clean URLs enabled and in a test I've written, I compare the current drupalGetHeader('location') to file_create_url($file-&gt;uri). The tests passes on my site, but on the qa.drupal.org testbot (and, presumably, on any site that doesn't have clean URLs enabled) the test fails.

Is there an API function that's more clean-URL-reflective to file_create_url()?
I ended up using

str_replace('/?q=', '/'drupalGetHeader('location'));


So basically I gave up on including the ?q= that appears in the URL and instead stripped it from everything. It seems a little messy but it works for my purpose. Still doesn't really answer the question though.

drupal_parse_url() looked promising at first, but it didn't work because  

drupal_parse_url(file_create_url($uri)) returned 'path' = http://example.com/path/to/file 

but 

drupal_parse_url(drupal_get_headers('location')) returned simply 'path' = /path/to/file