Malformed redirect link

Subliminal01Subliminal01 Registered Users Posts: 1 Beginner grinner
I'm having issues downloading videos via the API. When I make the download request using the video's url, I get a 302 http code in the response and 'X-Smug-RedirectTo' field in the header. Following the redirect link in the header gives me a 'Could not connect:<url> malformed' error. After inspecting the redirect link I noticed it was only a relative path to the file and did not include the host. What do I need to prepend/append to the redirect link to get the full url? Any help on how to handle this would be greatly appreciated

Comments

  • ktvoelkerktvoelker Registered Users Posts: 25 Big grins
    edited October 3, 2014
    It would be better to use the standard 'Location' header, although that won't solve your problem, since it will have the same value as 'X-Smug-RedirectTo'.

    Whichever header you use, relative references should be resolved against the original request URL, which means you would use the same scheme and host as the original request.

    If you are still having trouble, please email the details of the requests you are making to api@smugmug.com.
    Karl Voelker
    Sorcerer and API Guy at SmugMug
Sign In or Register to comment.