-
Notifications
You must be signed in to change notification settings - Fork 88
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: remove duplicate content type header #537
Conversation
@@ -103,9 +103,13 @@ const makeRequest = (httpVerb: string, scopes: string[]): Function => { | |||
|
|||
if (query.sampleHeaders) { | |||
query.sampleHeaders.forEach(header => { | |||
if (header.name !== '' && header.value !== '') { | |||
sampleHeaders[header.name] = header.value; | |||
if (header.name.toLowerCase() === 'content-type') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check that content-type value is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relying on the graph client to set the content type. Please add comment that content-type header is being set by Graph JavaScript client.
Fixes #533 |
} | ||
if (header.name === '' && header.value === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No use in setting a header if either value is empty string. I think this should be an or condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think this check is redundant now
@@ -103,9 +103,13 @@ const makeRequest = (httpVerb: string, scopes: string[]): Function => { | |||
|
|||
if (query.sampleHeaders) { | |||
query.sampleHeaders.forEach(header => { | |||
if (header.name !== '' && header.value !== '') { | |||
sampleHeaders[header.name] = header.value; | |||
if (header.name.toLowerCase() === 'content-type') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relying on the graph client to set the content type. Please add comment that content-type header is being set by Graph JavaScript client.
* shows message to direct users to the full graph explorer * hides the auth tab in try it * add function to delete items in bulk from storage * enables removal of bulk items from state * adds functionality to remove items in bulk from UI * changes text to get more features * increases padding between spinner and message * disables query sharing from the try-it experience * disables response expansion in try it * prevents response flickering after version change * attempts to fix sign in errors in edge * abstracts the create share link functionality * appends created share link to the try-it full experience url * renames query to shareableLink * reduces code into one-liner * renames action to be triggered * sets the production url as the share location * adds dialog to confirm deletion * fixes linting error * stops showing authentication text when minimised * adds localisation for history delete * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Check for instumentation key * Fix prop errors * Refactor getInstrumentationKey * Remove unused variable * increases spacing in profile to show names properly * changes wording and colour on info bar * shares link with authentication token * Sanitise url * commit translated contents * adds the language to the share liink * commit translated contents * replaces access token with email address in share link * adds a dialog to prompt mismatched users to login * commit translated contents * commit translated contents * commit translated contents * renames auth tab and snippets tabs * improves display of auth token * renames the Officedev link * adds modify permissions labelling * changes naming styles to sentence case * changes wording on delete history feature * adds tooltip message to share query and expand response button * adds a close button to expanded response * commit translated contents * fixes re-rendering problems on query response * Experiment: Check if a user can switch context without logging in * shows message instead of components when history items are missing * Fix lint errors * commit translated contents * commit translated contents * commit translated contents * Ask user to sign in if no session id * Asks user to log in if they do not have a session id * changes implementation from using an email to a session id * adds the language to the share link * commit translated contents * checks authentication status before creating link * adds the category to filters in the sidebar * bumps version to 4.0.5 * commit translated contents * commit translated contents * commit translated contents * adds tests for sample url generation * adds checks to url generation steps * utilises the parseUrl function for consistency * prevents fetching of scopes if url is invalid * fixes permissions error when url invalid * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Get instrumentation key from window object * Use dot instead of string * refactors showProfile logic to show correct profile * enhance vertical alignment * handles errors in catch statements; line spacing improvements * fixes faulty url encoding in the url * only show get requests - anonymous try-it * prepares march 17 2020 release * Bump acorn from 5.7.3 to 5.7.4 Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@5.7.3...5.7.4) Signed-off-by: dependabot[bot] <support@github.com> * shows long endpoints * increases padding in search texts * give context to the search place holder * moves files to feature folders * enables headers scrolling * remove cartoon references * adds icons to pivot items * displays icons only when on mobile view * adds an authentication required icon * displays tip after 403 error * change header names and add them to localisation * adds descriptive text to permissions tab * remove har as a property of Ihistory item * export query * exports bulk items * change modify permissions message * add aria controls to localization; hide icon when logged in * append category name to exported history item * change the privacy statement layout and words * change empty access token wording * adds a descriptive phrase below the samples tab * fix linting errors * adds headers tp share query link * refactor sample headers to display shared headers * fix linting errors * remove request headers reducers tests * change default value * use autolayout grids * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * fixes enter key press not running new query * add tooltips to the pivot items * add tooltip to request pivot items * fix linting errors * bump to v4.1.0 * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: align try it scroll bars (#478) * Feature: list all permissions (#477) * change samples endpoint * creates a new setting to handle permissions * changes permission to allow panel view and tab view * allow consent of multiple items at a go * enhance action creator to take state's url * enhance permissions hooks to enable dispatch fetchScopes * perform search when sample url changes * change snippets to use state devX api url * fix failing test * fix liniting errors * subscribe permissions to selected verb * move consent function to action creator for reusability * displays the permissions in order when in the panel * adds sorting tests * remove bulk permissions consent * create groups to categorise permissions * convert to class component :-( * select multiiple permissions for consent * accessibility edits * Improve messaging * display message of empty permissions * use object destructuring * change settings class component to hooks to fix close/reopen bug * Feature: Display blue dot present adaptive cards (#493) * create blue dot on tab * abstract adaptive cards lookup function * display dot on adaptive cards title when card template is present * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: responsive views (#496) * add app sections to make app.tsx more readable * treat screens with width less than 992px as mobile screens At point 992 is where the screen breaks * Fix: provide account choice on sign in (#497) * commit translated contents * Fix: Share query errors (#501) * fixes header undefined error when sharing link * add null check for headers passed from url * Fix: Stop Infinite spinning when login fails (#492) * stop infinite spinning and display error * add status text to localisation * fix failing internationalization * FIx: Build static assets for master & dev (#498) * Build static assets for master & dev * Build prod assets with prod client id * Fix typo * Fix typo in yml * Fix: try it logout (#502) * displays authentication section * enables logging out using a popup * add try it check when displaying authentication * Feature: add locale to headers devxapi (#500) * add accept-language to queries to the devxApi * remove localisation from sample queries * add placeholder texts to localisation * reuse locale code to enable url overriding * add reference to new translation files * delete unused translation files * add try catch to sample queries fetch * Fix: Remove redundant authentication (#518) * Task: responsive sidebar (#519) * bump breakpoint to 1260px * remove comments * Task: translate key value pair (#517) * Task: Remove opt out toggle (#516) * remove opt out toggle * remove opt out function * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Task: GA bug bash (#526) * add tooltip on the sample query name * add current locale to all links * fix permissions column misalignment * fix permissions tooltip mismatch * Fix: sidebar http methods (#527) * fixes unresponsive method badge * adds horizontal scrolling to the sidebar * Fix: Portuguese locale not loading (#529) * Task: refine permission column sizes (#528) * Fix: Misaligned sidebar elements (#530) * Task: localised login popup (#534) * Task: display settings icon mobile view (#535) * display the auth and settings on sidebar in mobile view * align auth to the left instead of indented * only show adaptive card after response is set * Release: 4.1.1 (#536) * bump to version 4.1.1 * create build files for 4.1.1 * Fix: remove duplicate content type header (#537) * dispatch thrown response * remove content type header * add comment on the reliance on the graph client * bump version to 4.1.2 * create build files Co-authored-by: Japheth Obala <japhethobalak@gmail.com> Co-authored-by: olprod <olprod@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* commit translated contents * Check for instumentation key * Fix prop errors * Refactor getInstrumentationKey * Remove unused variable * increases spacing in profile to show names properly * changes wording and colour on info bar * shares link with authentication token * Sanitise url * commit translated contents * adds the language to the share liink * commit translated contents * replaces access token with email address in share link * adds a dialog to prompt mismatched users to login * commit translated contents * commit translated contents * commit translated contents * renames auth tab and snippets tabs * improves display of auth token * renames the Officedev link * adds modify permissions labelling * changes naming styles to sentence case * changes wording on delete history feature * adds tooltip message to share query and expand response button * adds a close button to expanded response * commit translated contents * fixes re-rendering problems on query response * Experiment: Check if a user can switch context without logging in * shows message instead of components when history items are missing * Fix lint errors * commit translated contents * commit translated contents * commit translated contents * Ask user to sign in if no session id * Asks user to log in if they do not have a session id * changes implementation from using an email to a session id * adds the language to the share link * commit translated contents * checks authentication status before creating link * adds the category to filters in the sidebar * bumps version to 4.0.5 * commit translated contents * commit translated contents * commit translated contents * adds tests for sample url generation * adds checks to url generation steps * utilises the parseUrl function for consistency * prevents fetching of scopes if url is invalid * fixes permissions error when url invalid * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Get instrumentation key from window object * Use dot instead of string * refactors showProfile logic to show correct profile * enhance vertical alignment * handles errors in catch statements; line spacing improvements * fixes faulty url encoding in the url * only show get requests - anonymous try-it * prepares march 17 2020 release * Bump acorn from 5.7.3 to 5.7.4 Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@5.7.3...5.7.4) Signed-off-by: dependabot[bot] <support@github.com> * shows long endpoints * increases padding in search texts * give context to the search place holder * moves files to feature folders * enables headers scrolling * remove cartoon references * adds icons to pivot items * displays icons only when on mobile view * adds an authentication required icon * displays tip after 403 error * change header names and add them to localisation * adds descriptive text to permissions tab * remove har as a property of Ihistory item * export query * exports bulk items * change modify permissions message * add aria controls to localization; hide icon when logged in * append category name to exported history item * change the privacy statement layout and words * change empty access token wording * adds a descriptive phrase below the samples tab * fix linting errors * adds headers tp share query link * refactor sample headers to display shared headers * fix linting errors * remove request headers reducers tests * change default value * use autolayout grids * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * fixes enter key press not running new query * add tooltips to the pivot items * add tooltip to request pivot items * fix linting errors * bump to v4.1.0 * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: align try it scroll bars (#478) * Feature: list all permissions (#477) * change samples endpoint * creates a new setting to handle permissions * changes permission to allow panel view and tab view * allow consent of multiple items at a go * enhance action creator to take state's url * enhance permissions hooks to enable dispatch fetchScopes * perform search when sample url changes * change snippets to use state devX api url * fix failing test * fix liniting errors * subscribe permissions to selected verb * move consent function to action creator for reusability * displays the permissions in order when in the panel * adds sorting tests * remove bulk permissions consent * create groups to categorise permissions * convert to class component :-( * select multiiple permissions for consent * accessibility edits * Improve messaging * display message of empty permissions * use object destructuring * change settings class component to hooks to fix close/reopen bug * Feature: Display blue dot present adaptive cards (#493) * create blue dot on tab * abstract adaptive cards lookup function * display dot on adaptive cards title when card template is present * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: responsive views (#496) * add app sections to make app.tsx more readable * treat screens with width less than 992px as mobile screens At point 992 is where the screen breaks * Fix: provide account choice on sign in (#497) * commit translated contents * Fix: Share query errors (#501) * fixes header undefined error when sharing link * add null check for headers passed from url * Fix: Stop Infinite spinning when login fails (#492) * stop infinite spinning and display error * add status text to localisation * fix failing internationalization * FIx: Build static assets for master & dev (#498) * Build static assets for master & dev * Build prod assets with prod client id * Fix typo * Fix typo in yml * Fix: try it logout (#502) * displays authentication section * enables logging out using a popup * add try it check when displaying authentication * Feature: add locale to headers devxapi (#500) * add accept-language to queries to the devxApi * remove localisation from sample queries * add placeholder texts to localisation * reuse locale code to enable url overriding * add reference to new translation files * delete unused translation files * add try catch to sample queries fetch * Fix: Remove redundant authentication (#518) * Task: responsive sidebar (#519) * bump breakpoint to 1260px * remove comments * Task: translate key value pair (#517) * Task: Remove opt out toggle (#516) * remove opt out toggle * remove opt out function * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Task: GA bug bash (#526) * add tooltip on the sample query name * add current locale to all links * fix permissions column misalignment * fix permissions tooltip mismatch * Fix: sidebar http methods (#527) * fixes unresponsive method badge * adds horizontal scrolling to the sidebar * Fix: Portuguese locale not loading (#529) * Task: refine permission column sizes (#528) * Fix: Misaligned sidebar elements (#530) * Task: localised login popup (#534) * Task: display settings icon mobile view (#535) * display the auth and settings on sidebar in mobile view * align auth to the left instead of indented * only show adaptive card after response is set * Release: 4.1.1 (#536) * bump to version 4.1.1 * create build files for 4.1.1 * Fix: remove duplicate content type header (#537) * dispatch thrown response * remove content type header * add comment on the reliance on the graph client * Release/v4.1.2 (#538) * bump version to 4.1.2 * create build files * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Make Run Query button responsive * Fix indentation * Fix: select permissions pop up (#559) * fully closes the select permissions panel * remove false authenticated check * Fix: lowercase locales (#551) * change share query location from preview * adds a redirecturi in lowercase when signing in * localise locale section * Fix: snippets generation for queries with search parameters (#549) * re-render list when user consents to permission * Support for tenanted endpoint in Graph explorer. Currently to go a tenant in Graph Explorer, we need to create a local account in tenant. After this change a tenantId queryString parameter can be passed and then all login requests will go to that tenant. sample request https://developer.microsoft.com/en-us/graph/graph-explorer?tenantId=abc.onmicrosoft.com if no tenantId is specified, the request goes to common endpoint. Tested the redirection is happening correctly. * fixed lint errors * working changes * doe * displays logout option in dropdown on smaller screens * fixes documentation link colour and responsiveness * adds a token for user-id in the presence api * Updated redirect URI * linting checks * view query when history item is clicked * add json validation for sample queries * add message to localisation * add action to message * bump to version 4.1.3 * add 4.1.3 build files Co-authored-by: olprod <olprod@microsoft.com> Co-authored-by: jobala <japhethobalak@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhishek Agrawal <abhiagr@microsoft.com>
Overview
Removes duplicate content-type headers passed in from the sample queries
Demo
Testing Instructions