-
Notifications
You must be signed in to change notification settings - Fork 131
Description
Describe the bug
We recieved this email from Nylas support:
Hello,
Our internal alerting has flagged your system as sending invalid fields to our API. Our system is currently ignoring those invalid fields and fulfilling the API request, but we will be releasing an update in the future that will begin to deny API requests with invalid payloads. Please correct this to prevent any disruption.
The Nylas v3 API is receiving the following invalid field in your sending API payloads: "file_path"
You may have meant "filename"
Upon further inspection, this gem is the source of the file_path parameter via the Nylas::FileUtils.attach_file_request_builder method.
nylas-ruby/lib/nylas/utils/file_utils.rb
Lines 105 to 122 in 696d2c4
| def self.attach_file_request_builder(file_path, filename = nil, content_id = nil) | |
| filename ||= File.basename(file_path) | |
| content_type = MIME::Types.type_for(file_path) | |
| content_type = if !content_type.nil? && !content_type.empty? | |
| content_type.first.to_s | |
| else | |
| "application/octet-stream" | |
| end | |
| size = File.size(file_path) | |
| content = File.new(file_path, "rb") | |
| { | |
| filename: filename, | |
| content_type: content_type, | |
| size: size, | |
| content: content, | |
| content_id: content_id, | |
| file_path: file_path | |
| } |
SDK Version:
We are on 6.2.0