Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

405 METHOD NOT ALLOWED #88

Open
mmellado opened this issue Mar 10, 2017 · 5 comments
Open

405 METHOD NOT ALLOWED #88

mmellado opened this issue Mar 10, 2017 · 5 comments
Labels

Comments

@mmellado
Copy link

mmellado commented Mar 10, 2017

I'm trying to make a call using fetch but no matter what site I try to hit I get a 450 Method not allowed.

I'm using it this way:

const options = {
  "method": "GET",
  "headers": {
     "accept":  "application/json",
     "content-type": "application/json"
   }
};

fetch('http://crossorigin.me/http://google.com', options)
        .then(res => res.text())
        .then(res => console.log(res));

output:

VM912:2 OPTIONS http://crossorigin.me/http://google.com 405 (Method Not Allowed)

(index):1 Fetch API cannot load http://crossorigin.me/http://google.com. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3003' is therefore not allowed access. The response had HTTP status code 405. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Is this a bug or am I just not using crossorigin.me correctly?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@hyperobject
Copy link
Owner

Couldn't replicate that - could you give me some more details on the context you're using that code in?

@mmellado
Copy link
Author

It's a frontend application using GitHub's Fetch polyfill to make the request. This happens both when trying to make the call from my script or when copying the code into the developer tool's console and triggering it from there. This is currently being run from a local development node server at localhost:3000

@Banderi
Copy link

Banderi commented May 24, 2017

I'm getting the same error in response for other requests.
E.g.:

$.post("http://crossorigin.me/http://google.com");
...
POST http://crossorigin.me/http://google.com 405 (Method Not Allowed)
XMLHttpRequest cannot load http://crossorigin.me/http://google.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://semicolon.altervista.org' is therefore not allowed access. The response had HTTP status code 405.

@hyperobject
Copy link
Owner

@Banderi That's because POST isn't implemented, so it's not allowed.

@Banderi
Copy link

Banderi commented May 25, 2017

You mean $.post isn't, or the POST method altogether isn't? In any case, without 50% of the ajax working I find this service quite lacking.. don't get me wrong, I appreciate the free service, but I thought the whole point would be to proxy simple ajax requests.

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

No branches or pull requests

3 participants