Git Product home page Git Product logo

Comments (4)

Deimos avatar Deimos commented on June 17, 2024

(sorry if you already saw this, but just going to specifically ping you in case you weren't expecting anyone else to submit issues)

@JordanMilne

from advocate.

JordanMilne avatar JordanMilne commented on June 17, 2024

Thanks for the ping @Deimos, I took a look at the code and looks like I made a copy/paste error. When we wrap the head method in RequestsAPIWrapper we're currently doing:

        self.options = self._default_arg_wrapper(options)
        self.head = self._default_arg_wrapper(options) # wrapping options instead of `head`!
        self.post = self._default_arg_wrapper(post)

I'm guessing you're getting Insufficient information. Origin request header needed. because S3 assumes that all OPTIONS requests are for CORS preflights and is confused when it doesn't see the Origin header.

I'll patch this and push an update to PyPI this afternoon.

from advocate.

Deimos avatar Deimos commented on June 17, 2024

Yep, that'd definitely do it (and would explain why I was getting strange CORS-ish-sounding errors when I tried manually adding an Origin header to see what would happen).

from advocate.

JordanMilne avatar JordanMilne commented on June 17, 2024

This is fixed in 0.6.2 on PyPI:

In [1]: import advocate

In [2]: advocate.__version__
Out[2]: '0.6.2'

In [3]: wrapper = advocate.RequestsAPIWrapper(advocate.AddrValidator())

In [4]: wrapper.head('https://b.thumbs.redditmedia.com/6hn7cHXUEXSYh8K5ga-LCeHWBpPADv6cS6-34ty2RuE.jpg')
Out[4]: <Response [200]>

from advocate.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.