jetruby / apollo_upload_server-ruby

MIT License
180 stars 50 forks source link

Early return if not multipart/form-data content type #39

Closed yiyidai closed 3 years ago

yiyidai commented 3 years ago

Early return if not multipart/form-data content type

fuelen commented 3 years ago

Hey @yiyidai

I'm not sure this error should be fixed this way. ApolloUploadServer should work only with multipart/form-data content type, otherwise it should be noop. I think this part

request = ActionDispatch::Request.new(env)

should be invoked only if content type == 'multipart/form-data'

yiyidai commented 3 years ago

Hi @fuelen , what you suggested makes sense. I'll pushed a new change to the PR, please take a look. Thanks!

fuelen commented 3 years ago

@yiyidai Looks great! Thank you for the fix!