Skip to content
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

Bug : URL redirection does not seem to work properly in UDC #53

Closed
sanchit-saini opened this issue Mar 9, 2021 · 4 comments
Closed

Comments

@sanchit-saini
Copy link

Hello,

rtracklayer relies on the kent library and It seems UDC(URL data cache) does not handle URL redirection properly that is causing lawremi/rtracklayer#42 issue.

I tested udcFileMayOpen function with "http://bedbase.org/api/bed/78c0e4753d04b238fc07e4ebe5a02984/file/bigbedfile"
For ease of testing, I inserted the following code segment in the src/utils/bedToBigBed utility (in the usage function).

void usage()
/* Explain usage and exit. */
{
struct udcFile *udcTestFile =
udcFileMayOpen("http://bedbase.org/api/bed/78c0e4753d04b238fc07e4ebe5a02984/file/bigbedfile", udcDefaultDir());
if (udcTestFile == NULL)
    printf("Not Working\n");
else
    printf("Working\n");
...

After compilation received Not working as output. This function udcInfoViaHttp seems related to the URL direction. I would be happy to help.

Thanks!

@genome-www
Copy link

genome-www commented Mar 9, 2021 via email

@sanchit-saini
Copy link
Author

Okay, understood. Thanks, I never thought about questioning the server.
I tested it with another URL. It worked as expected.

@nsheff
Copy link

nsheff commented Mar 10, 2021

Just to add for future reference, this is because bedbase is built using fastAPI, which does not provide HEAD responses automatically for GET endpoints. The issue is documented here: fastapi/fastapi#1773

In practice you don't always need the HEAD response to follow the URL redirect; browsers, wget for example will still work, it just depends on whether the requester relies on the HEAD response or doesn't -- but the UCSC code does require it. Anyway, we will solve it on our end for now and and per that issue, fastAPI should eventually support HEAD automatically.

@genome-www
Copy link

genome-www commented Mar 10, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants