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

Allows modifying http headers #977

Merged
merged 7 commits into from Mar 30, 2022

Conversation

GULERTOLGA
Copy link
Contributor

setHttpHeaders(<String,String> {"somehttpheaderkey":"somehttpheadervalue"});

You can use this method if you want to modify the http headers before tile requests are made. Like adding an authorization header to requests...

@GULERTOLGA GULERTOLGA changed the title Allows modifying http headers. Allows modifying http headers Mar 27, 2022
@felix-ht
Copy link
Collaborator

make sure to run swift and java format (check ci)

@GULERTOLGA
Copy link
Contributor Author

I just can't get past the Java code formatting. Android Studio > Code > Reformat Code. Is there anything else I should do?

@felix-ht
Copy link
Collaborator

wget https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar

java -jar google-java-format-1.13.0-all-deps.jar -i $(find . -type f -name "*.java")

@felix-ht
Copy link
Collaborator

felix-ht commented Mar 29, 2022

might be a good idea to add a make file to run format with one command (not here)

@felix-ht
Copy link
Collaborator

if you want i can run the format an push it into the branch

@GULERTOLGA
Copy link
Contributor Author

if you want i can run the format an push it into the branch

I will be pleased. I can't run the command you said. First I had a java version problem. Then when I ran the command I got the following error. Actually I formatted the code with google Formatter plugin but still couldn't solve it.

error: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0x22e98aa) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x22e98aa
java.lang.IllegalAccessError: class com.google.googlejavaformat.java.JavaInput (in unnamed module @0x22e98aa) cannot access class com.sun.tools.javac.parser.Tokens$TokenKind (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.parser to unnamed module @0x22e98aa
        at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:349)
        at com.google.googlejavaformat.java.JavaInput.buildToks(JavaInput.java:334)
        at com.google.googlejavaformat.java.JavaInput.<init>(JavaInput.java:276)
        at com.google.googlejavaformat.java.Formatter.getFormatReplacements(Formatter.java:280)
        at com.google.googlejavaformat.java.Formatter.formatSource(Formatter.java:267)

@felix-ht
Copy link
Collaborator

did the push

in this case you could run the command like so:

 java \  
  --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
  --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
  -jar google-java-format-1.13.0-all-deps.jar -i $(find . -type f -name "*.java")

@GULERTOLGA
Copy link
Contributor Author

Thanks. By the way, this command line is almost more than code I've committed :)

Copy link
Collaborator

@felix-ht felix-ht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN March 30, 2022 08:58 Inactive
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN March 30, 2022 08:58 Inactive
@felix-ht felix-ht merged commit 04d7d14 into flutter-mapbox-gl:master Mar 30, 2022
FreeGrow added a commit to FreeGrow/maps that referenced this pull request Sep 21, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants