Search Results

Search found 55652 results on 2227 pages for 'http response'.

Page 51/2227 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Using nginx's proxy_redirect when the response location's domain varies

    - by Chalky
    I am making an web app using SoundCloud's API. Requesting an MP3 to stream involves two requests. I'll give an example. Firstly: http://api.soundcloud.com/tracks/59815100/stream This returns a 302 with a temporary link to the actual MP3 (which varies each time), for example: http://ec-media.soundcloud.com/xYZk0lr2TeQf.128.mp3?ff61182e3c2ecefa438cd02102d0e385713f0c1faf3b0339595667fd0907ea1074840971e6330e82d1d6e15dd660317b237a59b15dd687c7c4215ca64124f80381e8bb3cb5&AWSAccessKeyId=AKIAJ4IAZE5EOI7PA7VQ&Expires=1347621419&Signature=Usd%2BqsuO9wGyn5%2BrFjIQDSrZVRY%3D The issue I had was that I am attempting to load the MP3 via JavaScript's XMLHTTPRequest, and for security reasons the browser can't follow the 302, as ec-media.soundcloud.com does not set a header saying it is safe for the browser to access via XMLHTTPRequest. So instead of using the SoundCloud URL, I set up two locations in nginx, so the browser only interacts with the server my app is hosted on and no security errors come up: location /soundcloud/tracks/ { # rewrite URL to match api.soundcloud.com's URL structure rewrite \/soundcloud\/tracks\/(\d*) /tracks/$1/stream break; proxy_set_header Host api.soundcloud.com; proxy_pass http://api.soundcloud.com; # the 302 will redirect to /soundcloud/media instead of the original domain proxy_redirect http://ec-media.soundcloud.com /soundcloud/media; } location /soundcloud/media/ { rewrite \/soundcloud\/media\/(.*) /$1 break; proxy_set_header Host ec-media.soundcloud.com; proxy_pass http://ec-media.soundcloud.com; } So myserver/soundcloud/tracks/59815100 returns a 302 to /myserver/soundcloud/media/xYZk0lr2TeQf.128.mp3...etc, which then forwards the MP3 on. This works! However, I have hit a snag. Sometimes the 302 location is not ec-media.soundcloud.com, it's ak-media.soundcloud.com. There are possibly even more servers out there and presumably more could appear at any time. Is there any way I can handle an arbitrary 302 location without having to manually enter each possible variation? Or is it possible for nginx to handle the redirect and return the response of the second step? So myserver/soundcloud/tracks/59815100 follows the 302 behind the scenes and returns the MP3? The browser automatically follows the redirect, so I can't do anything with the initial response on the client side. I am new to nginx and in a bit over my head so apologies if I've missed something obvious, or it's beyond the scope of nginx. Thanks a lot for reading.

    Read the article

  • Apache Proxy HTTP CONNECT method enabled

    - by John
    I'm using Apache as reverse proxy for several different projects. PCI-DSS compliance scanning shows that my Apache is having HTTP CONNECT method enabled. as stated on Acunetix's site - http://www.acunetix.com/vulnerabilities/apache-proxy-http-connect-metho/ As far as I know, CONNECT is used by the web server to tunnel SSL to application server. Any suggestion how should I fix this? Otherwise, anyone know how should I perform the test if my Apache's HTTP CONNECT method is enabled/disabled?

    Read the article

  • Which org.apache.http is android using? And where can i get that as a jar?

    - by Janusz
    At the moment I'm trying to build some integration tests for an android project. I would like to use the same apache http classes I use on the android. Which version is this and can I get a jar of that somewhere? Trying to use the jar that comes with android only resolves in Exceptions... But most of the tests won't need running them in the emulator all the time just because I use some apache libraries or do they?

    Read the article

  • What's the simplest way to call Http GET url using Delphi?

    - by Mohammed Nasman
    There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing. I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code to my application. UPDATE: sorry if I was not clear, I meant by "not to add complex indy code", that I don't want add indy components for just this simple task, and prefer more lighter way for that.

    Read the article

  • What HTTP error code should I use for unauthorised access to a protected image?

    - by Bala Clark
    I am writing a web application that has secure images uploaded by users. These images are only available to the owner when logged in. I am wondering what the best HTTP error code to throw in the case of unauthorised access? Would a 404 not found, or a 403 unauthorised be better? I am leaning towards the 403, but would it be better to hide the fact that the resource exists to unauthorised users be better?

    Read the article

  • What's right for me: htAccess, form submittion, HTTP header authentication w/ PHP?

    - by Brook Julias
    I am creating a website with multiple sections--admin, client, user, and anonymous--each user group having less access then the next. I am wondering what form of authentication would be best for my use? I have heard the if you are just dealing with a websites then a web form is for you (because it's prettier). HTTP header authentication with PHP is said to get clunky/sloppy. htAcess is pretty much the hard core of various authentication methods I have looked up, but is it too much?

    Read the article

  • How do I clone over HTTP a repository that has no info/refs?

    - by gbacon
    Given a repository served over HTTP whose owner forgot to chmod +x hooks/post-update, is there a workaround for cloning it? I tried running wget --mirror url, but rather than fetching the subtree only, it tried to mirror the entire site—which I assume happened due to the parent-directory links in the autogenerated index.html resources.

    Read the article

  • What's an appropriate HTTP status code to return by a REST API service for a validation failure?

    - by michaeljoseph
    I'm currently returning 401 Unauthorized whenever I encounter a validation failure in my Django/Piston based REST API application. Having had a look at the HTTP Status Code Registry I'm not convinced that this is an appropriate code for a validation failure, what do y'all recommend? 400 Bad Request 401 Unauthorized 403 Forbidden 405 Method Not Allowed 406 Not Acceptable 412 Precondition Failed 417 Expectation Failed 422 Unprocessable Entity 424 Failed Dependency Update: "Validation failure" above means an application level data validation failure ie. incorrectly specified datetime, bogus email address etc.

    Read the article

  • How to create a simple c# http monitor/blocker?

    - by Click Ok
    I was reading that question (http://stackoverflow.com/questions/226784/how-to-create-a-simple-proxy-in-c) that is near of my wishes. I simply want develop a c# app that, by example, monitors Firefox, IE, etc and logs all navigated pages. Depending of the visited page, I want to block the site (like a parental filter). Code snippets/samples are good, but if you can just tell me some direction of that classes to use I will be grateful. :-)

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >