Skip to content
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

--headers doesn't support header values containing equals symbol #343

Closed
ceuk opened this issue Sep 21, 2023 · 2 comments
Closed

--headers doesn't support header values containing equals symbol #343

ceuk opened this issue Sep 21, 2023 · 2 comments

Comments

@ceuk
Copy link

ceuk commented Sep 21, 2023

Hi, I was testing out adding arbitrary headers with the --headers flag added in 1.0.0 and unfortunately it looks like there doesn't seem to be a way to pass a header value containing =

e.g.

mgc users calendar calendar-view list --debug --user-id <Redacted> --start-date-time "$(date --iso-8601=seconds)" --end-date-time "$(date --iso-8601=seconds -d '+1 week')" --headers Prefer="outlook.timezone=GMT"

Will result in the header value being truncated at the = symbol:

      Request:
      
      GET https://graph.microsoft.com/v1.0/users/<Redacted>/calendar/calendarView?startDateTime=2023-09-21T11%3A10%3A44%2B01%3A00&endDateTime=2023-09-28T11%3A10%3A44%2B01%3A00&$top=5&$orderby=start%2FdateTime&$select=subject%2Corganizer%2Cstart%2Cend HTTP/1.1
      Accept: application/json
      Authorization: [PROTECTED]
      FeatureFlag: 00000043
      Cache-Control: no-store, no-cache
      User-Agent: kiota-dotnet/1.1.1
      SdkVersion: graph-cli-1.0/1.0.0, graph-dotnet-core/3.0.11 (featureUsage=0000002B; hostOS=Unix 6.5.3.1; hostArch=X64; runtimeEnvironment=.NET 7.0.11;)
      client-request-id: 8654b7a4-fe03-424d-944b-e0b5b7647ca4
      Prefer: outlook.timezone

(You can see the header value on the last line of the debug output above)

I've tried various logical variations of providing the header value e.g.

--headers Prefer="outlook.timezone\=GMT"

Results in: Prefer: outlook.timezone\

--headers Prefer="outlook.timezone\\=GMT"

Results in: Prefer: outlook.timezone\\

--headers Prefer="outlook.timezone%3DGMT"

Results in: Prefer: outlook.timezone%3DGMT (which isn't parsed correctly downstream by the looks of it, so still doesn't work)

I've also tried numerous combinations of quotes, double & single, nested, escaped etc. None of which made a difference

@calebkiage
Copy link
Contributor

This is a bug in the parsing. I'll work on a fix for this. Thanks for testing and providing feedback. We really appreciate this.

@calebkiage
Copy link
Contributor

This should be fixed in RC1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants