<commit_before>package com.microsoft.graph.functional;

import com.microsoft.graph.authentication.IAuthenticationProvider;
import com.microsoft.graph.http.IHttpRequest;
import com.microsoft.graph.httpcore.ICoreAuthenticationProvider;

import okhttp3.Request;

public class TestBaseAuthenticationProvider implements IAuthenticationProvider, ICoreAuthenticationProvider {
    private String _accessToken;
    public TestBaseAuthenticationProvider(String accessToken) {
        _accessToken = accessToken;
    }
    @Override
    public Request authenticateRequest(Request request) {
        return request.newBuilder().addHeader("Authorization", "Bearer " + _accessToken).build();
    }

    @Override
    public void authenticateRequest(IHttpRequest request) {
        request.addHeader("Authorization",
                                "Bearer " + _accessToken);
    }
    
}<commit_msg>- avoids sending tokens to large file uploads urls<commit_after>package com.microsoft.graph.functional;

import com.microsoft.graph.authentication.IAuthenticationProvider;
import com.microsoft.graph.http.IHttpRequest;
import com.microsoft.graph.httpcore.ICoreAuthenticationProvider;

import okhttp3.Request;

public class TestBaseAuthenticationProvider implements IAuthenticationProvider, ICoreAuthenticationProvider {
    private String _accessToken;
    private String hostNameToCheck = "graph";
    public TestBaseAuthenticationProvider(String accessToken) {
        _accessToken = accessToken;
    }
    @Override
    public Request authenticateRequest(Request request) {
        if(request.url().host().toLowerCase().contains(hostNameToCheck))
            return request.newBuilder().addHeader("Authorization", "Bearer " + _accessToken).build();
        else
            return request;
    }

    @Override
    public void authenticateRequest(IHttpRequest request) {
        if(request.getRequestUrl().getHost().toLowerCase().contains(hostNameToCheck))
            request.addHeader("Authorization",
                                "Bearer " + _accessToken);
    }
    
}
{'fraction_non_alphanumeric': 0.08434318952981096, 'fraction_numerical': 0.0009694619486185168, 'mean_word_length': 3.8679245283018866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2408192', 'n_tokens_mistral': 519, 'n_tokens_neox': 503, 'n_words': 99}