-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a null pointer in OperationView.js in headers #1122
Conversation
The check for "Download" content type in OperationView.js does not determine if the header is available before checking the regular expression. If the header is not available, then the operation will fail and the behavior will resemble: swagger-api#1109 This issue appears to extend to other content types, including application/xml, or any not explicitly defined before the "Download" conditional. Simply checking for a null value before testing the regular expression is enough to get things to work properly again.
@mohsen1 - can you please review this one? I imagine it'd need a rebase but no point asking for one if it's not the right solution. |
Null pointer is one issue, the other issue is we're using
|
@TomDataworks - can you rebase the PR and make the additional change @mohsen1 suggested? Looks like this could help us solve several issues. |
I tested PR manually, Error: TypeError: headers['Content-Disposition'] is undefined is fixed now. This code part does the trick.
|
The check for "Download" content type in OperationView.js does not
determine if the header is available before checking the regular
expression. If the header is not available, then the operation will
fail and the behavior will resemble:
#1109
This issue appears to extend to other content types, including
application/yaml, or any not explicitly defined before the
"Download" conditional. Simply checking for a null value before
testing the regular expression is enough to get things to work
properly again.