GithubHelp home page GithubHelp logo

httpdisk's People

Contributors

gurgeous avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

httpdisk's Issues

uninitialized constant HTTPDisk::Cache::Tempfile

➜  mm-sales-db git:(master) ✗ → gem install httpdisk
➜  mm-sales-db git:(master) ✗ → httpdisk https://s3.amazonaws.com/irs-form-990/201932849349300103_public.xml
httpdisk: uninitialized constant HTTPDisk::Cache::Tempfile

This also occurs when using the library directly. It's easy enough in my own project to require 'tempfile', but it seems like httpdisk should require it itself.

Thanks!

Exception when charset is `nil`

Thanks for this gem. It's been super helpful in a scraping project I've been fiddling with this weekend.

An Exception will get raised when charset is nil, even when utf8: true option is enabled. For example when Content-Type: text/xml as in https://s3.amazonaws.com/irs-form-990/201932849349300103_public.xml

There are several ways to handle this, I'm not sure your preference, but likely changing

return Encoding.find(content_type.charset) if content_type
to be only run if content_type && content_type.charset. Alternatively, we could call content_type.charset.to_s and the code path should raise an ArgumentError (unknown encoding name - )

I'm happy to do a PR, but maybe it's simple enough for your to take a quick peak.

Thanks!

`httpdisk-grep` chokes on non-gzip files

I was using httpdisk-grep to clean up some failures and ran into this issue.

httpdisk-grep -h "HTTPDISK 403"
httpdisk-grep: not in gzip format (.DS_Store) # << this is unexpected
rm -rf ./**/.DS_Store

httpdisk-grep -h "HTTPDISK 403"
httpdisk-grep: 809: unexpected token at ...

Are you OK with it changing to warn on non-gzip formats as opposed to exiting?

IDEA: Before cache persist and cache fetch callbacks

When working on my project, there were a few API calls that would be in an error state, but the API creator responded with an HTTP 200 instead of a 4xx or 5xx.

It would be nice if we could provide custom callbacks before persisting or before using a cache to transform the response -- in my case either changing the status code/being able to tell httpdisk that it should be an error code based on the contents of the message.

Similarly, when popping a value out of the cache, it would be nice to be able to mutate the response or tell httpdisk that it's a :miss on custom logic.

What do you think?

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.